зеркало из https://github.com/mozilla/gecko-dev.git
Fix 29219, a=gagan
This commit is contained in:
Родитель
39ff02a526
Коммит
22da84ab41
|
@ -351,12 +351,23 @@ nsresult nsHTTPResponse::ParseHeader(nsCString& aHeaderString)
|
|||
nsCOMPtr<nsIAtom> headerAtom;
|
||||
|
||||
colonOffset = aHeaderString.FindChar(':');
|
||||
if (kNotFound == colonOffset) {
|
||||
if (kNotFound == colonOffset)
|
||||
{
|
||||
//
|
||||
// The header is malformed... Just clear it.
|
||||
// The header is malformed... But - there're malformed headers in the world. Search
|
||||
// for ' '/\t to simulate 4.x/IE behavior
|
||||
//
|
||||
aHeaderString.Truncate();
|
||||
return NS_ERROR_FAILURE;
|
||||
colonOffset = aHeaderString.FindChar(' ');
|
||||
if (kNotFound == colonOffset)
|
||||
{
|
||||
colonOffset = aHeaderString.FindChar('\t');
|
||||
if (kNotFound == colonOffset)
|
||||
{
|
||||
// oh well. That's really malformed - fail the call
|
||||
aHeaderString.Truncate();
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
(void) aHeaderString.Left(headerKey, colonOffset);
|
||||
headerKey.ToLowerCase();
|
||||
|
|
Загрузка…
Ссылка в новой задаче