[webkit-reviews] review granted: [Bug 46146] XMLHttpRequest: responseXML returns null if the Content-Type is valid (end in +xml) in some cases : [Attachment 374555] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 30 10:03:46 PDT 2019


youenn fablet <youennf at gmail.com> has granted Rob Buis <rbuis at igalia.com>'s
request for review:
Bug 46146: XMLHttpRequest: responseXML returns null if the Content-Type is
valid (end in +xml) in some cases
https://bugs.webkit.org/show_bug.cgi?id=46146

Attachment 374555: Patch

https://bugs.webkit.org/attachment.cgi?id=374555&action=review




--- Comment #21 from youenn fablet <youennf at gmail.com> ---
Comment on attachment 374555
  --> https://bugs.webkit.org/attachment.cgi?id=374555
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=374555&action=review

> Source/WebCore/xml/XMLHttpRequest.cpp:844
> +	       mimeType =
m_response.httpHeaderField(HTTPHeaderName::ContentType);

Reusing mimeType makes the code more difficult to read.
How about creating a new variable named contentType instead.

> Source/WebCore/xml/XMLHttpRequest.cpp:848
> +	       mimeType = parsedContentType->mimeType();

We could return early with "return parsedContentType->mimeType();"

> Source/WebCore/xml/XMLHttpRequest.cpp:850
>	       mimeType = "text/xml"_s;

Ditto to return early.


More information about the webkit-reviews mailing list