Skip to content

Fixes missing Content-Length header when body is empty - #1778

Merged
kdavisk6 merged 3 commits into
OpenFeign:masterfrom
c00ler:avenderov/1229/post-empty-body
Oct 7, 2022
Merged

kdavisk6 merged 3 commits into
OpenFeign:masterfrom
c00ler:avenderov/1229/post-empty-body

Conversation

@c00ler

@c00ler c00ler commented Oct 3, 2022

Copy link
Copy Markdown
Contributor

The DefaultClient was modified to add the missing Content-Length header to POST and PUT requests. PATCH request is not supported by the HttpUrlConnection. Since Content-Length is the restricted header, I set the empty body, and its length is calculated by the HttpUrlConnection.

Fixes #1229

Comment thread pom.xml
<artifactId>maven-install-plugin</artifactId>
<version>${maven-install-plugin.version}</version>
<configuration>
<createChecksum>true</createChecksum>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread java11/pom.xml
<scope>test</scope>
</dependency>

<dependency>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated dependencies

@kdavisk6
kdavisk6 merged commit b596abe into OpenFeign:master Oct 7, 2022
@c00ler
c00ler deleted the avenderov/1229/post-empty-body branch October 7, 2022 07:04
velo pushed a commit that referenced this pull request Oct 7, 2024
velo pushed a commit that referenced this pull request Oct 8, 2024
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

Successfully merging this pull request may close these issues.

Default Client does not include Content-Length header for POST with Empty Body

2 participants