зеркало из https://github.com/mozilla/gecko-dev.git
Bug 959333 - HTTP/2 should say so in the status line. r=mcmanus
This commit is contained in:
Родитель
cec4290744
Коммит
15ca033083
|
@ -501,6 +501,9 @@ HttpConnInfo::SetHTTP1ProtocolVersion(uint8_t pv)
|
|||
case NS_HTTP_VERSION_1_1:
|
||||
protocolVersion.Assign(NS_LITERAL_STRING("http/1.1"));
|
||||
break;
|
||||
case NS_HTTP_VERSION_2_0:
|
||||
protocolVersion.Assign(NS_LITERAL_STRING("http/2.0"));
|
||||
break;
|
||||
default:
|
||||
protocolVersion.Assign(NS_LITERAL_STRING("unknown protocol version"));
|
||||
}
|
||||
|
|
|
@ -411,7 +411,7 @@ Http2Decompressor::OutputHeader(const nsACString &name, const nsACString &value)
|
|||
|
||||
// Status comes first
|
||||
if (name.Equals(NS_LITERAL_CSTRING(":status"))) {
|
||||
nsAutoCString status(NS_LITERAL_CSTRING("HTTP/1.1 "));
|
||||
nsAutoCString status(NS_LITERAL_CSTRING("HTTP/2.0 "));
|
||||
status.Append(value);
|
||||
status.Append(NS_LITERAL_CSTRING("\r\n"));
|
||||
mOutput->Insert(status, 0);
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#define NS_HTTP_VERSION_0_9 9
|
||||
#define NS_HTTP_VERSION_1_0 10
|
||||
#define NS_HTTP_VERSION_1_1 11
|
||||
#define NS_HTTP_VERSION_2_0 20
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
|
|
@ -55,7 +55,9 @@ nsHttpResponseHead::Flatten(nsACString &buf, bool pruneTransients)
|
|||
return;
|
||||
|
||||
buf.AppendLiteral("HTTP/");
|
||||
if (mVersion == NS_HTTP_VERSION_1_1)
|
||||
if (mVersion == NS_HTTP_VERSION_2_0)
|
||||
buf.AppendLiteral("2.0 ");
|
||||
else if (mVersion == NS_HTTP_VERSION_1_1)
|
||||
buf.AppendLiteral("1.1 ");
|
||||
else
|
||||
buf.AppendLiteral("1.0 ");
|
||||
|
@ -766,7 +768,9 @@ nsHttpResponseHead::ParseVersion(const char *str)
|
|||
int major = atoi(str + 1);
|
||||
int minor = atoi(p);
|
||||
|
||||
if ((major > 1) || ((major == 1) && (minor >= 1)))
|
||||
if ((major > 2) || ((major == 2) && (minor >= 0)))
|
||||
mVersion = NS_HTTP_VERSION_2_0;
|
||||
else if ((major == 1) && (minor >= 1))
|
||||
// at least HTTP/1.1
|
||||
mVersion = NS_HTTP_VERSION_1_1;
|
||||
else
|
||||
|
|
Загрузка…
Ссылка в новой задаче