This commit is contained in:
ruslan%netscape.com 2000-05-30 22:50:29 +00:00
Родитель e2d7e69004
Коммит e134c507f0
1 изменённых файлов: 15 добавлений и 4 удалений

Просмотреть файл

@ -351,13 +351,24 @@ 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
//
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();
//