LibWeb/XHR: Pass API URL character encoding
Some checks are pending
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run

This commit is contained in:
Bastian Müller 2024-10-19 16:16:22 -07:00 committed by Tim Flynn
parent 3be93ac49f
commit 748e3c2e6c
Notes: github-actions[bot] 2024-10-20 11:59:17 +00:00

View file

@ -20,12 +20,12 @@
#include <LibURL/Origin.h> #include <LibURL/Origin.h>
#include <LibWeb/Bindings/XMLHttpRequestPrototype.h> #include <LibWeb/Bindings/XMLHttpRequestPrototype.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOMURL/DOMURL.h>
#include <LibWeb/DOM/DocumentLoading.h> #include <LibWeb/DOM/DocumentLoading.h>
#include <LibWeb/DOM/Event.h> #include <LibWeb/DOM/Event.h>
#include <LibWeb/DOM/EventDispatcher.h> #include <LibWeb/DOM/EventDispatcher.h>
#include <LibWeb/DOM/IDLEventListener.h> #include <LibWeb/DOM/IDLEventListener.h>
#include <LibWeb/DOM/XMLDocument.h> #include <LibWeb/DOM/XMLDocument.h>
#include <LibWeb/DOMURL/DOMURL.h>
#include <LibWeb/Fetch/BodyInit.h> #include <LibWeb/Fetch/BodyInit.h>
#include <LibWeb/Fetch/Fetching/Fetching.h> #include <LibWeb/Fetch/Fetching/Fetching.h>
#include <LibWeb/Fetch/Infrastructure/FetchAlgorithms.h> #include <LibWeb/Fetch/Infrastructure/FetchAlgorithms.h>
@ -481,8 +481,10 @@ WebIDL::ExceptionOr<void> XMLHttpRequest::open(String const& method_string, Stri
auto normalized_method = Fetch::Infrastructure::normalize_method(method); auto normalized_method = Fetch::Infrastructure::normalize_method(method);
// 5. Let parsedURL be the result of parsing url with thiss relevant settings objects API base URL and thiss relevant settings objects API URL character encoding. // 5. Let parsedURL be the result of parsing url with thiss relevant settings objects API base URL and thiss relevant settings objects API URL character encoding.
// FIXME: Pass in thiss relevant settings objects API URL character encoding. auto& relevant_settings_object = HTML::relevant_settings_object(*this);
auto parsed_url = DOMURL::parse(url, HTML::relevant_settings_object(*this).api_base_url(), {}); auto api_base_url = relevant_settings_object.api_base_url();
auto api_url_character_encoding = relevant_settings_object.api_url_character_encoding();
auto parsed_url = DOMURL::parse(url, api_base_url, api_url_character_encoding);
// 6. If parsedURL is failure, then throw a "SyntaxError" DOMException. // 6. If parsedURL is failure, then throw a "SyntaxError" DOMException.
if (!parsed_url.is_valid()) if (!parsed_url.is_valid())