chrome does not accept chunked gzip encoding for http/1.0 protocol version

master
Dirk Engling 7 months ago
parent d3985b00b5
commit ff03fd7449

@ -165,11 +165,11 @@ ssize_t http_sendiovecdata(const int64 sock, struct ot_workstruct *ws, int iovec
encoding = "Content-Encoding: bzip2\r\n"; encoding = "Content-Encoding: bzip2\r\n";
if (!(cookie->flag & STRUCT_HTTP_FLAG_CHUNKED)) if (!(cookie->flag & STRUCT_HTTP_FLAG_CHUNKED))
header_size = asprintf(&header, "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\n%sContent-Length: %zd\r\n\r\n", encoding, size); header_size = asprintf(&header, "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n%sContent-Length: %zd\r\n\r\n", encoding, size);
else { else {
if (!(cookie->flag & STRUCT_HTTP_FLAG_CHUNKED_IN_TRANSFER)) { if (!(cookie->flag & STRUCT_HTTP_FLAG_CHUNKED_IN_TRANSFER)) {
header_size = header_size =
asprintf(&header, "HTTP/1.0 200 OK\r\nContent-Type: application/octet-stream\r\n%sTransfer-Encoding: chunked\r\n\r\n%zx\r\n", encoding, size); asprintf(&header, "HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\n%sTransfer-Encoding: chunked\r\n\r\n%zx\r\n", encoding, size);
cookie->flag |= STRUCT_HTTP_FLAG_CHUNKED_IN_TRANSFER; cookie->flag |= STRUCT_HTTP_FLAG_CHUNKED_IN_TRANSFER;
} else } else
header_size = asprintf(&header, "%zx\r\n", size); header_size = asprintf(&header, "%zx\r\n", size);

Loading…
Cancel
Save