Closed kthy closed 2 years ago
I think this is unfortunately a Firefox issue rather than a Rouille one. If you take a look at RFC2616 Section 4.4 you'll find the paragraph:
Messages MUST NOT include both a Content-Length header field and a non-identity transfer-coding. If the message does include a non-identity transfer-coding, the Content-Length MUST be ignored.
Firefox is relying on the presence of a header that the spec specifically prohibits, I don't think we can fix that in Rouille without violating the spec for every other use case.
It is a Firefox issue, but the inability to set Content-Length
means I didn't have a workaround. I wasn't aware of that limitation in the RFC, though. 😢
Closing, sorry about the noise.
You can work around it by forcing an HTTP 1.0 request (as HTTP 1.0 doesn't support chunked).
Using a <script>
tag to make a raw connection via net.connect
should be straightforward if a bit of a hack.
Using rust 2021 stable on Windows 10 (
rustc-1.57.0
).Minimal repro application (created using
cargo new rouille-content-length-missing --bin
):Cargo.toml
src/main.rs
index.html
(The
.wav
file can be anything, I've just used a standard Windows system sound for the example.)Retrieving
http://localhost:2635/index.html
in my browser, I would expect to see aContent-Length: 171564
header, but this is what I get:The missing
Content-Length
then leads me to experience Firefox bug 1416976 where the audio control shows the length of the WAV file as 6h45m48s.