mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 741218 - Don't crash when loading a page with content-type application/json; r=hsivonen
This commit is contained in:
parent
2ded0a7107
commit
93421f3fbd
1
content/html/document/crashtests/741218.json
Normal file
1
content/html/document/crashtests/741218.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
1
content/html/document/crashtests/741218.json^headers^
Normal file
1
content/html/document/crashtests/741218.json^headers^
Normal file
@ -0,0 +1 @@
|
||||
Content-Type: application/json
|
@ -13,3 +13,4 @@ load 495543.svg
|
||||
load 564461.xhtml
|
||||
load 601422.html
|
||||
load 631421.html
|
||||
load 741218.json
|
||||
|
@ -584,14 +584,15 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
|
||||
}
|
||||
|
||||
bool html = contentType.EqualsLiteral(TEXT_HTML);
|
||||
bool xhtml = !html && contentType.Equals("application/xhtml+xml");
|
||||
bool xhtml = !html && contentType.EqualsLiteral(APPLICATION_XHTML_XML);
|
||||
bool plainText = !html && !xhtml && (contentType.EqualsLiteral(TEXT_PLAIN) ||
|
||||
contentType.EqualsLiteral(TEXT_CSS) ||
|
||||
contentType.EqualsLiteral(APPLICATION_JAVASCRIPT) ||
|
||||
contentType.EqualsLiteral(APPLICATION_XJAVASCRIPT) ||
|
||||
contentType.EqualsLiteral(TEXT_ECMASCRIPT) ||
|
||||
contentType.EqualsLiteral(APPLICATION_ECMASCRIPT) ||
|
||||
contentType.EqualsLiteral(TEXT_JAVASCRIPT));
|
||||
contentType.EqualsLiteral(TEXT_JAVASCRIPT) ||
|
||||
contentType.EqualsLiteral(APPLICATION_JSON));
|
||||
if (!(html || xhtml || plainText || viewSource)) {
|
||||
MOZ_NOT_REACHED("Channel with bad content type.");
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
Loading…
Reference in New Issue
Block a user