Bug 561042 - remove http headers size limit. r=bz

This commit is contained in:
arno renevier 2011-07-24 13:46:33 +02:00
Родитель 508d3cef6d
Коммит 8b113fa3f1
3 изменённых файлов: 41 добавлений и 7 удалений

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

@ -75,9 +75,6 @@ extern PRThread *gSocketThread;
static NS_DEFINE_CID(kMultiplexInputStream, NS_MULTIPLEXINPUTSTREAM_CID);
// mLineBuf is limited to this number of bytes.
#define MAX_LINEBUF_LENGTH (1024 * 10)
// Place a limit on how much non-compliant HTTP can be skipped while
// looking for a response header
#define MAX_INVALID_RESPONSE_BODY_SIZE (1024 * 128)
@ -828,10 +825,6 @@ nsHttpTransaction::ParseLineSegment(char *segment, PRUint32 len)
}
// append segment to mLineBuf...
if (mLineBuf.Length() + len > MAX_LINEBUF_LENGTH) {
LOG(("excessively long header received, canceling transaction [trans=%x]", this));
return NS_ERROR_ABORT;
}
mLineBuf.Append(segment, len);
// a line buf with only a new line char signifies the end of headers.

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

@ -0,0 +1,40 @@
do_load_httpd_js();
const SERVER_PORT = 8080;
const baseURL = "http://localhost:" + SERVER_PORT + "/";
var cookie = "";
for (let i =0; i < 10000; i++) {
cookie += " big cookie";
}
var listener = {
onStartRequest: function (request, ctx) {
},
onDataAvailable: function (request, ctx, stream) {
},
onStopRequest: function (request, ctx, status) {
do_check_eq(status, Components.results.NS_OK);
do_test_finished();
},
};
function run_test() {
var server = new nsHttpServer();
server.start(SERVER_PORT);
server.registerPathHandler('/', function(metadata, response) {
response.setStatusLine(metadata.httpVersion, 200, "OK");
response.setHeader("Set-Cookie", "BigCookie=" + cookie, false);
response.write("Hello world");
});
var ios = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService);
var chan = ios.newChannel(baseURL, null, null)
.QueryInterface(Components.interfaces.nsIHttpChannel);
chan.asyncOpen(listener, null);
do_test_pending();
}

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

@ -52,6 +52,7 @@ tail =
[test_bug540566.js]
[test_bug543805.js]
[test_bug553970.js]
[test_bug561042.js]
[test_bug561276.js]
[test_bug580508.js]
[test_bug586908.js]