LibWeb/XHR: Parse URL to resolve blob
This commit is contained in:
parent
4fdb266077
commit
3be93ac49f
Notes:
github-actions[bot]
2024-10-20 11:59:23 +00:00
Author: https://github.com/turbolent 🔰 Commit: https://github.com/LadybirdBrowser/ladybird/commit/3be93ac49fc Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1874 Reviewed-by: https://github.com/trflynn89
3 changed files with 17 additions and 1 deletions
|
@ -0,0 +1 @@
|
|||
PASS
|
|
@ -0,0 +1,14 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
asyncTest(done => {
|
||||
const xhr = new XMLHttpRequest();
|
||||
const data = "PASS";
|
||||
const url = URL.createObjectURL(new Blob([data]));
|
||||
xhr.open("GET", url);
|
||||
xhr.onload = function () {
|
||||
println(xhr.responseText);
|
||||
done();
|
||||
};
|
||||
xhr.send();
|
||||
});
|
||||
</script>
|
|
@ -20,6 +20,7 @@
|
|||
#include <LibURL/Origin.h>
|
||||
#include <LibWeb/Bindings/XMLHttpRequestPrototype.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOMURL/DOMURL.h>
|
||||
#include <LibWeb/DOM/DocumentLoading.h>
|
||||
#include <LibWeb/DOM/Event.h>
|
||||
#include <LibWeb/DOM/EventDispatcher.h>
|
||||
|
@ -481,7 +482,7 @@ WebIDL::ExceptionOr<void> XMLHttpRequest::open(String const& method_string, Stri
|
|||
|
||||
// 5. Let parsedURL be the result of parsing url with this’s relevant settings object’s API base URL and this’s relevant settings object’s API URL character encoding.
|
||||
// FIXME: Pass in this’s relevant settings object’s API URL character encoding.
|
||||
auto parsed_url = HTML::relevant_settings_object(*this).api_base_url().complete_url(url);
|
||||
auto parsed_url = DOMURL::parse(url, HTML::relevant_settings_object(*this).api_base_url(), {});
|
||||
|
||||
// 6. If parsedURL is failure, then throw a "SyntaxError" DOMException.
|
||||
if (!parsed_url.is_valid())
|
||||
|
|
Loading…
Add table
Reference in a new issue