Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speak about considerations of byte counting and transfer-encoding #2679

Open
LPardue opened this issue Nov 10, 2023 · 3 comments · May be fixed by #2746
Open

Speak about considerations of byte counting and transfer-encoding #2679

LPardue opened this issue Nov 10, 2023 · 3 comments · May be fixed by #2746

Comments

@LPardue
Copy link
Contributor

LPardue commented Nov 10, 2023

Ted Hardie asked:

How does the upload offset calculation interact with transfer encoding/compression? I'm reporting how many bytes came through the network, is that right?

We probably would benefit from some consideration text to mention how HTTP/1.1 transfer-encoding might be a footgun if the server counted those bytes naiively.

@LPardue LPardue changed the title Speak about considerations of byte counting and transfer-econding Speak about considerations of byte counting and transfer-encoding Nov 10, 2023
@Acconut
Copy link
Member

Acconut commented Nov 23, 2023

I agree, we should clarify this. I was also confused about the exact behavior until you helped me clear it up. Is the following summary correct?

  • From a client's perspective, the offset is counted after Content-Encoding is applied but before Transfer-Encoding is applied.
  • From a server's perspective, the offset is counted after the message is decoded using Transfer-Encoding but before decoding using Content-Encoding.

@smatsson
Copy link

To add to Marius' list above: Can the server do anything about a request where only part of a message with transfer-encoding arrives? E.g. a partial message with transfer-encoding: gzip might not be possible to decode.

@gstrauss
Copy link

gstrauss commented Dec 3, 2023

HTTP/1.1 Transfer-Encoding is a hop-by-hop header at an HTTP protocol layer and should be ignored by application frameworks such as resumable upload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

4 participants