diff --git a/netwerk/protocol/http/ASpdySession.cpp b/netwerk/protocol/http/ASpdySession.cpp index d1fdf5a1685c..6371faf771ba 100644 --- a/netwerk/protocol/http/ASpdySession.cpp +++ b/netwerk/protocol/http/ASpdySession.cpp @@ -82,8 +82,12 @@ SpdyInformation::SpdyInformation() ALPNCallbacks[2] = Http2Session::ALPNCallback; Version[3] = NS_HTTP2_DRAFT_VERSION; - VersionString[3] = NS_LITERAL_CSTRING(NS_HTTP2_DRAFT_TOKEN); + VersionString[3] = NS_LITERAL_CSTRING("h2-15"); ALPNCallbacks[3] = Http2Session::ALPNCallback; + + Version[4] = NS_HTTP2_DRAFT_VERSION; + VersionString[4] = NS_LITERAL_CSTRING(NS_HTTP2_DRAFT_TOKEN); + ALPNCallbacks[4] = Http2Session::ALPNCallback; } bool @@ -98,6 +102,7 @@ SpdyInformation::ProtocolEnabled(uint32_t index) const return gHttpHandler->IsHttp2Enabled(); case 2: case 3: + case 4: return gHttpHandler->IsHttp2DraftEnabled(); } return false; diff --git a/netwerk/protocol/http/ASpdySession.h b/netwerk/protocol/http/ASpdySession.h index c7a19223cd3e..d553f7f80ce0 100644 --- a/netwerk/protocol/http/ASpdySession.h +++ b/netwerk/protocol/http/ASpdySession.h @@ -74,7 +74,7 @@ public: SpdyInformation(); ~SpdyInformation() {} - static const uint32_t kCount = 4; + static const uint32_t kCount = 5; // determine the index (0..kCount-1) of the spdy information that // correlates to the npn string. NS_FAILED() if no match is found. diff --git a/netwerk/protocol/http/nsHttp.h b/netwerk/protocol/http/nsHttp.h index 6c5419e72217..ede634e5c7f5 100644 --- a/netwerk/protocol/http/nsHttp.h +++ b/netwerk/protocol/http/nsHttp.h @@ -39,15 +39,15 @@ namespace net { // 27 was http/2-draft09, h2-10, and h2-11 // 28 was http/2-draft12 // 29 was http/2-draft13 - // 30 was also h2-14. They're effectively the same, -15 just adds one - // error code. So, we advertise both, but our "default position" is -15. - HTTP2_VERSION_DRAFT15 = 30 + // 30 was also h2-14 and -15. They're effectively the same, -15 added an + // error code. So, we advertise all, but our "default position" is -16. + HTTP2_VERSION_DRAFT16 = 30 }; typedef uint8_t nsHttpVersion; -#define NS_HTTP2_DRAFT_VERSION HTTP2_VERSION_DRAFT15 -#define NS_HTTP2_DRAFT_TOKEN "h2-15" +#define NS_HTTP2_DRAFT_VERSION HTTP2_VERSION_DRAFT16 +#define NS_HTTP2_DRAFT_TOKEN "h2-16" //----------------------------------------------------------------------------- // http connection capabilities diff --git a/netwerk/test/unit/test_http2.js b/netwerk/test/unit/test_http2.js index 0d796a4fbfd3..155c60e75add 100644 --- a/netwerk/test/unit/test_http2.js +++ b/netwerk/test/unit/test_http2.js @@ -25,7 +25,7 @@ var bigListenerMD5 = '8f607cfdd2c87d6a7eedb657dafbd836'; function checkIsHttp2(request) { try { - if (request.getResponseHeader("X-Firefox-Spdy") == "h2-15") { + if (request.getResponseHeader("X-Firefox-Spdy") == "h2-16") { if (request.getResponseHeader("X-Connection-Http2") == "yes") { return true; } @@ -378,7 +378,7 @@ var altsvcClientListener = { function altsvcHttp1Server(metadata, response) { response.setStatusLine(metadata.httpVersion, 200, "OK"); response.setHeader("Content-Type", "text/plain", false); - response.setHeader("Alt-Svc", 'h2-15=":6944"', false); + response.setHeader("Alt-Svc", 'h2-16=":6944"', false); var body = "this is where a cool kid would write something neat.\n"; response.bodyOutputStream.write(body, body.length); } diff --git a/testing/xpcshell/node-http2/lib/protocol/index.js b/testing/xpcshell/node-http2/lib/protocol/index.js index fab2015fcf60..c655f4b251bc 100644 --- a/testing/xpcshell/node-http2/lib/protocol/index.js +++ b/testing/xpcshell/node-http2/lib/protocol/index.js @@ -37,7 +37,7 @@ // [node-https]: http://nodejs.org/api/https.html // [node-http]: http://nodejs.org/api/http.html -exports.VERSION = 'h2-15'; +exports.VERSION = 'h2-16'; exports.Endpoint = require('./endpoint').Endpoint;