1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 17:48:12 +00:00

LibWeb: Consider content-type charset when determining XML encoding

This commit is contained in:
Idan Horowitz 2023-11-17 15:12:03 +02:00 committed by Andreas Kling
parent 07ea3ab306
commit 278e8afb42
3 changed files with 24 additions and 15 deletions

View file

@ -319,7 +319,7 @@ void XMLHttpRequest::set_document_response()
// 6. Otherwise, let document be a document that represents the result of running the XML parser with XML scripting support disabled on xhrs received bytes. If that fails (unsupported character encoding, namespace well-formedness error, etc.), then return null.
else {
document = DOM::XMLDocument::create(realm(), m_response->url().value_or({}));
if (!Web::build_xml_document(*document, m_received_bytes)) {
if (!Web::build_xml_document(*document, m_received_bytes, {})) {
m_response_object = Empty {};
return;
}