[vlc-commits] [Git][videolan/vlc][master] http: chunked: fix chunked transfer encoding output
Jean-Baptiste Kempf
gitlab at videolan.org
Tue May 11 16:43:10 UTC 2021
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
88388b6f by Alexandre Janniaux at 2021-05-11T16:23:55+00:00
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
- - - - -
1 changed file:
- modules/access/http/chunked.c
Changes:
=====================================
modules/access/http/chunked.c
=====================================
@@ -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)
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/88388b6f51cbb4000bce68895e2332aa6b54afea
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/88388b6f51cbb4000bce68895e2332aa6b54afea
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list