Skip to content
Snippets Groups Projects
Commit 88388b6f authored by Alexandre Janniaux's avatar Alexandre Janniaux Committed by Jean-Baptiste Kempf
Browse files

http: chunked: fix chunked transfer encoding output

Chunks in chunked transfer-encoding are supposed to be ended with \r\n.
Without that, servers can be confused on how to parse the next chunk
size, and are typically returning a 400 Bad Request. This can be seen in
the Mozilla developer documentation[1], or more exhaustively in the
document RFC[2] section 4.1.

This is in particular needed to signal that no other headers are exposed
in the chunk.

[1]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding#chunked_encoding
[2]: https://datatracker.ietf.org/doc/html/rfc7230#section-4.1
parent 7cb75e56
No related branches found
No related tags found
1 merge request!109http: chunked: fix chunked transfer encoding output
Pipeline #95571 passed with stages
in 41 minutes and 26 seconds
......@@ -49,6 +49,8 @@ ssize_t vlc_https_chunked_write(struct vlc_tls *tls, const void *base,
return -1;
if (vlc_tls_Write(tls, base, len) < (ssize_t)len)
return -1;
if (vlc_tls_Write(tls, "\r\n", 2) < 2)
return -1;
}
if (eos)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment