Open
Description
If I write:
import 'dart:convert';
import 'dart:io';
main() async {
var server = await HttpServer.bind('127.0.0.1', 8080);
await for (var request in server) {
request.response.headers.set('transfer-encoding', 'gzip chunked');
request.response.add(GZIP.encoder.convert(UTF8.encode('foo')));
request.response.close();
}
}
And I make a GET / request, I get back:
HTTP/1.1 200 OK
content-type: text/plain; charset=utf-8
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
transfer-encoding: gzip chunked
x-content-type-options: nosniff
K��!es�
I'd expect:
HTTP/1.1 200 OK
content-type: text/plain; charset=utf-8
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
transfer-encoding: gzip chunked
x-content-type-options: nosniff
17
K��!es�
0
Normally the server will apply the chunked transfer encoding based on the Transfer-Encoding
header, but in this case it's not doing so. And, since there's no explicit way to tell the server whether or not to apply a chunked encoding, there's not really a good workaround here other than manually re-implementing chunked encoding and specifically only applying that implementation if there are multiple encodings specified.