mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 21:12:08 +02:00
LibWeb: Don't crash in XHR.response{,XML} for empty XML document
There were some unhandled paths due to the liberally typed XHR response object. This patch flushes out those issues by using a tighter type set in the Variant. (NonnullGCPtr<Object> instead of Value)
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 07:43:05 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/2b343c9508 Pull-request: https://github.com/SerenityOS/serenity/pull/21362
@@ -0,0 +1,16 @@
|
||||
<script src="include.js"></script>
|
||||
<script>
|
||||
asyncTest((done) => {
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.responseType = "document";
|
||||
xhr.open("GET", "data:text/xml,", true);
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === 4 && xhr.status === 200) {
|
||||
let xml = xhr.responseXML;
|
||||
println("PASS"); // Didn't crash :^)
|
||||
done();
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user