mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-06 09:01:53 +00:00
LibWeb: Port EnvironmentSettings URL Parsing to return Optional<URL>
This commit is contained in:
parent
5f5d18d719
commit
2c8dab36f3
Notes:
github-actions[bot]
2025-02-19 13:03:33 +00:00
Author: https://github.com/shannonbooth
Commit: 2c8dab36f3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3609
Reviewed-by: https://github.com/trflynn89
8 changed files with 25 additions and 25 deletions
|
@ -46,11 +46,11 @@ WebIDL::ExceptionOr<GC::Ref<EventSource>> EventSource::construct_impl(JS::Realm&
|
|||
auto url_record = settings.encoding_parse_url(url);
|
||||
|
||||
// 4. If urlRecord is failure, then throw a "SyntaxError" DOMException.
|
||||
if (!url_record.is_valid())
|
||||
if (!url_record.has_value())
|
||||
return WebIDL::SyntaxError::create(realm, MUST(String::formatted("Invalid URL '{}'", url)));
|
||||
|
||||
// 5. Set ev's url to urlRecord.
|
||||
event_source->m_url = move(url_record);
|
||||
event_source->m_url = url_record.release_value();
|
||||
|
||||
// 6. Let corsAttributeState be Anonymous.
|
||||
auto cors_attribute_state = CORSSettingAttribute::Anonymous;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue