diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2024-04-17 15:03:14 +0200 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2024-04-17 15:03:14 +0200 |
| commit | ff03fd74496620e884bdf9bfec47afaf7e4e4d1a (patch) | |
| tree | 92cdf6cdf7f7184852dfa5fae4a02a4e4d7bb2e4 | |
| parent | d3985b00b5fb272f6d8bb8ba8ac50b493c40082d (diff) | |
chrome does not accept chunked gzip encoding for http/1.0 protocol version
| -rw-r--r-- | ot_http.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -165,11 +165,11 @@ ssize_t http_sendiovecdata(const int64 sock, struct ot_workstruct *ws, int iovec | |||
| 165 | encoding = "Content-Encoding: bzip2\r\n"; | 165 | encoding = "Content-Encoding: bzip2\r\n"; |
| 166 | 166 | ||
| 167 | if (!(cookie->flag & STRUCT_HTTP_FLAG_CHUNKED)) | 167 | if (!(cookie->flag & STRUCT_HTTP_FLAG_CHUNKED)) |
| 168 | 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); | 168 | 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); |
| 169 | else { | 169 | else { |
| 170 | if (!(cookie->flag & STRUCT_HTTP_FLAG_CHUNKED_IN_TRANSFER)) { | 170 | if (!(cookie->flag & STRUCT_HTTP_FLAG_CHUNKED_IN_TRANSFER)) { |
| 171 | header_size = | 171 | header_size = |
| 172 | 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); | 172 | 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); |
| 173 | cookie->flag |= STRUCT_HTTP_FLAG_CHUNKED_IN_TRANSFER; | 173 | cookie->flag |= STRUCT_HTTP_FLAG_CHUNKED_IN_TRANSFER; |
| 174 | } else | 174 | } else |
| 175 | header_size = asprintf(&header, "%zx\r\n", size); | 175 | header_size = asprintf(&header, "%zx\r\n", size); |
