mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 06:18:59 +00:00
LibWeb/HTML: Parse URL track URL before creating fetch request
This is a bit weird in the spec in it passing through a string here instead of a URL record. However, the string being used in this case should only ever be a valid URL string if it is not the empty string.
This commit is contained in:
parent
1257d0c1a8
commit
277aceac98
Notes:
github-actions[bot]
2025-03-04 21:26:28 +00:00
Author: https://github.com/shannonbooth
Commit: 277aceac98
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3668
Reviewed-by: https://github.com/trflynn89
1 changed files with 4 additions and 1 deletions
|
@ -6,6 +6,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibURL/Parser.h>
|
||||
#include <LibWeb/Bindings/HTMLTrackElementPrototype.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
|
@ -191,7 +192,9 @@ void HTMLTrackElement::start_the_track_processing_model_parallel_steps(JS::Realm
|
|||
if (!url.is_empty()) {
|
||||
// 1. Let request be the result of creating a potential-CORS request given URL, "track", and corsAttributeState,
|
||||
// and with the same-origin fallback flag set.
|
||||
auto request = create_potential_CORS_request(realm.vm(), url, Fetch::Infrastructure::Request::Destination::Track, cors_attribute_state, SameOriginFallbackFlag::Yes);
|
||||
auto parsed_url = URL::Parser::basic_parse(url);
|
||||
VERIFY(parsed_url.has_value());
|
||||
auto request = create_potential_CORS_request(realm.vm(), parsed_url.release_value(), Fetch::Infrastructure::Request::Destination::Track, cors_attribute_state, SameOriginFallbackFlag::Yes);
|
||||
|
||||
// 2. Set request's client to the track element's node document's relevant settings object.
|
||||
request->set_client(&document().relevant_settings_object());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue