mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb/XHR: Isomorphic decode accessing XMLHttpRequest response headers
Fixes a crash on: https://wpt.live/html/browsers/browsing-the-web/navigating-across-documents/refresh/subresource.any.html
This commit is contained in:
parent
731c2365b6
commit
e74ca82083
Notes:
github-actions[bot]
2025-01-15 12:36:55 +00:00
Author: https://github.com/shannonbooth
Commit: e74ca82083
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3111
Reviewed-by: https://github.com/AtkinsSJ ✅
4 changed files with 47 additions and 14 deletions
|
@ -0,0 +1,29 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
asyncTest(async (done) => {
|
||||
try {
|
||||
const httpServer = httpTestServer();
|
||||
const url = await httpServer.createEcho("GET", "/xml-http-request-response-header-decoding", {
|
||||
status: 200,
|
||||
headers: {
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
"Access-Control-Expose-Headers": "Refresh",
|
||||
"Refresh": "0;./refreshed.txt?\u0080\u00FF",
|
||||
},
|
||||
body: "",
|
||||
});
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", url);
|
||||
|
||||
xhr.addEventListener("load", () => {
|
||||
println(`getAllResponseHeaders()\n${xhr.getAllResponseHeaders().replace('\r','')}`);
|
||||
println(`getResponseHeader("Refresh") => '${xhr.getResponseHeader("Refresh")}'`);
|
||||
done();
|
||||
});
|
||||
xhr.send();
|
||||
} catch (err) {
|
||||
console.log("FAIL - " + err);
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue