From bbcc3aa46d919fc7fbc22ef83a58203b1b79db8d Mon Sep 17 00:00:00 2001 From: "darin%netscape.com" Date: Thu, 2 Aug 2001 19:28:08 +0000 Subject: [PATCH] Fixes bug 88792 "redirection with no final \r\n not processed" r=bbaetz, sr=dougt git-svn-id: svn://10.0.0.236/trunk@100212 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/netwerk/protocol/http/src/nsHttpHeaderArray.cpp | 1 + mozilla/netwerk/protocol/http/src/nsHttpTransaction.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/mozilla/netwerk/protocol/http/src/nsHttpHeaderArray.cpp b/mozilla/netwerk/protocol/http/src/nsHttpHeaderArray.cpp index fcfe82ae3cc..195b1b0ef39 100644 --- a/mozilla/netwerk/protocol/http/src/nsHttpHeaderArray.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHttpHeaderArray.cpp @@ -156,6 +156,7 @@ PRBool nsHttpHeaderArray::CanAppendToHeader(nsHttpAtom header) { return header == nsHttp::Accept_Charset || + header == nsHttp::Content_Type || header == nsHttp::User_Agent || header == nsHttp::Referer || header == nsHttp::Host || diff --git a/mozilla/netwerk/protocol/http/src/nsHttpTransaction.cpp b/mozilla/netwerk/protocol/http/src/nsHttpTransaction.cpp index 17b2c03d2bc..210a2a614a5 100644 --- a/mozilla/netwerk/protocol/http/src/nsHttpTransaction.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHttpTransaction.cpp @@ -736,6 +736,13 @@ nsHttpTransaction::Read(char *buf, PRUint32 count, PRUint32 *bytesWritten) // return would block to prevent being called again. return NS_BASE_STREAM_WOULD_BLOCK; } + if (!mHaveAllHeaders && !mLineBuf.IsEmpty()) { + // the server has not sent the final \r\n terminating the header section, + // and there is still a header line unparsed. let's make sure we parse + // the remaining header line, and then hopefully, the response will be + // usable (see bug 88792). + ParseLineSegment("\n", 1); + } return rv; }