1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 17:58:12 +00: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:
Andreas Kling 2023-10-07 07:57:16 +02:00
parent c21efdfc8a
commit 2b343c9508
6 changed files with 48 additions and 11 deletions

View file

@ -183,7 +183,7 @@ private:
// response object
// An object, failure, or null, initially null.
// NOTE: This needs to be a JS::Value as the JSON response might not actually be an object.
Variant<JS::Value, Failure, Empty> m_response_object;
Variant<JS::NonnullGCPtr<JS::Object>, Failure, Empty> m_response_object;
// https://xhr.spec.whatwg.org/#xmlhttprequest-fetch-controller
// fetch controller