mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-13 07:53:23 -05:00
Don't use chunked encoding on range requests
If the client is requesting a partial file, don't use chunked encoding. This makes video files work in iTunes.
This commit is contained in:
parent
3c941ca0e1
commit
2f04529165
@ -2014,7 +2014,9 @@ evhttp_send_reply_start(struct evhttp_request *req, int code,
|
|||||||
evhttp_connection_stop_detectclose(req->evcon);
|
evhttp_connection_stop_detectclose(req->evcon);
|
||||||
|
|
||||||
evhttp_response_code(req, code, reason);
|
evhttp_response_code(req, code, reason);
|
||||||
if (req->major == 1 && req->minor == 1) {
|
/* If the client is requesting a partial file, don't use
|
||||||
|
* chunked encoding, or video files won't work in iTunes. */
|
||||||
|
if (req->major == 1 && req->minor == 1 && code == 200) {
|
||||||
/* use chunked encoding for HTTP/1.1 */
|
/* use chunked encoding for HTTP/1.1 */
|
||||||
evhttp_add_header(req->output_headers, "Transfer-Encoding",
|
evhttp_add_header(req->output_headers, "Transfer-Encoding",
|
||||||
"chunked");
|
"chunked");
|
||||||
|
Loading…
Reference in New Issue
Block a user