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

HTTP: revert aggressively removing request content-type header when request body is empty #4509

Closed
slandelle opened this issue Jan 15, 2024 · 0 comments
Assignees
Milestone

Comments

@slandelle
Copy link
Member

As of #4429, we're aggressively removing request content-type header when request body is empty.
This is wrong, some content-types have valid empty string value, such as application/x-www-form-urlencoded.

Let's only not add a request content-type when using asJson and asXml when there's no body as an empty string is not a valid content for these encodings.

@slandelle slandelle self-assigned this Jan 15, 2024
@slandelle slandelle added this to the 3.10.4 milestone Jan 15, 2024
slandelle added a commit that referenced this issue Jan 15, 2024
… body is empty, close #4509

Motivation:

As of #4429, we're aggressively removing request content-type header when request body is empty.
This is wrong, some content-types have valid empty string value, such as application/x-www-form-urlencoded.

Let's only not add a request content-type when using asJson and asXml when there's no body as an empty string is not a valid content for these encodings.

Modification:

Introduce HeadersBuiltIn that's only resolved when building the request.
slandelle added a commit that referenced this issue Jan 19, 2024
… body is empty, close #4509

Motivation:

As of #4429, we're aggressively removing request content-type header when request body is empty.
This is wrong, some content-types have valid empty string value, such as application/x-www-form-urlencoded.

Let's only not add a request content-type when using asJson and asXml when there's no body as an empty string is not a valid content for these encodings.

Modification:

Introduce HeadersBuiltIn that's only resolved when building the request.
slandelle added a commit that referenced this issue Feb 9, 2024
slandelle added a commit that referenced this issue Feb 9, 2024
@slandelle slandelle changed the title HTTP: revert aggressively removing requst content-type header when request body is empty HTTP: revert aggressively removing request content-type header when request body is empty Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant