mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02: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:
committed by
Sam Atkins
parent
731c2365b6
commit
e74ca82083
Notes:
github-actions[bot]
2025-01-15 12:36:55 +00:00
Author: https://github.com/shannonbooth Commit: https://github.com/LadybirdBrowser/ladybird/commit/e74ca820833 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3111 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -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>
|
||||
Reference in New Issue
Block a user