bug 1105302 - Fix to use indexed encoding for cookies more than 20 bytes r=mcmanus

This commit is contained in:
Shigeki Ohtsu 2014-11-26 23:44:50 +09:00
parent 685439f93a
commit bb18946770
2 changed files with 2 additions and 2 deletions

View File

@ -911,7 +911,7 @@ Http2Compressor::EncodeHeaderBlock(const nsCString &nvInput,
nsDependentCSubstring cookie = Substring(beginBuffer + nextCookie,
beginBuffer + semiSpaceIndex);
// cookies less than 20 bytes are not indexed
ProcessHeader(nvPair(name, cookie), false, name.Length() < 20);
ProcessHeader(nvPair(name, cookie), false, cookie.Length() < 20);
nextCookie = semiSpaceIndex + 2;
}
} else {

View File

@ -259,7 +259,7 @@ function test_http2_header() {
// Test to make sure cookies are split into separate fields before compression
function test_http2_cookie_crumbling() {
var chan = makeChan("https://localhost:6944/cookie_crumbling");
var cookiesSent = ['a=b', 'c=d', 'e=f'].sort();
var cookiesSent = ['a=b', 'c=d01234567890123456789', 'e=f'].sort();
chan.setRequestHeader("Cookie", cookiesSent.join('; '), false);
var listener = new Http2HeaderListener("X-Received-Header-Pairs", function(pairsReceived) {
var cookiesReceived = JSON.parse(pairsReceived).filter(function(pair) {