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

ESP8266HTTPClient sets Content-Length even on empty GET-requests #9200

Open
6 tasks done
dakhnod opened this issue Oct 16, 2024 · 1 comment
Open
6 tasks done

ESP8266HTTPClient sets Content-Length even on empty GET-requests #9200

dakhnod opened this issue Oct 16, 2024 · 1 comment

Comments

@dakhnod
Copy link

dakhnod commented Oct 16, 2024

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: ESP8266
  • Core Version:
  • Development Env: Any
  • Operating System: Any

Settings in IDE

Problem Description

Due to this line, the HTTP client always sets the Content-Length header.
I think this header should be omitted for GET-requests with a length of 0.

@mcspr
Copy link
Collaborator

mcspr commented Oct 18, 2024

Yup, RFC seems to imply we should not include it
https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.2
https://datatracker.ietf.org/doc/html/rfc7230#section-3.3

I would guess our client has a similar problem that Dart's one had at some point
dart-lang/sdk@6c254fa

Do you have an example of a server that breaks with current behavior?

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

2 participants