зеркало из https://github.com/mozilla/pjs.git
Bug 741218 - Don't crash when loading a page with content-type application/json; r=hsivonen
This commit is contained in:
Родитель
e7729f2300
Коммит
7da3925fac
|
@ -0,0 +1 @@
|
|||
{}
|
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче