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

Uploading: Provide a way to not set Content-Length #65

Closed
yutakahirano opened this issue Aug 2, 2016 · 2 comments
Closed

Uploading: Provide a way to not set Content-Length #65

yutakahirano opened this issue Aug 2, 2016 · 2 comments

Comments

@yutakahirano
Copy link
Owner

The current spec says:

  1. Let contentLengthValue be null.
  2. If httpRequest's body is null and httpRequest's method is POST or PUT, then set contentLengthValue to 0.
  3. If httpRequest's body is non-null, set contentLengthValue to httpRequest's body's total bytes, utf-8 encoded.
  4. If contentLengthValue is non-null, append Content-Length/contentLengthValue to httpRequest's header list.

We should not append a Content-Length header when uploading a Request made with a ReadableStream.

@yutakahirano yutakahirano changed the title Request uploading: Provide a way to not set Content-Length Uploading: Provide a way to not set Content-Length Aug 2, 2016
@annevk
Copy link

annevk commented Aug 4, 2016

We should probably annotate body in some way. Either it's known-length (everything we do today) or unknown (streams).

@wanderview
Copy link

We should probably annotate body in some way. Either it's known-length (everything we do today) or unknown (streams).

FWIW, this matches exactly what we have to do at the implementation level. So sounds good to me.

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

No branches or pull requests

3 participants