Skip to content

WebClient: DELETE request should not send transfer-encoding: chunked header [SPR-15947] #20500

Closed
@spring-projects-issues

Description

@spring-projects-issues

Abhijit Sarkar opened SPR-15947 and commented

Using 5.0.0.BUILD-SNAPSHOT, not RC3.

The WebClient sends a transfer-encoding: chunked header for all requests which confuses some servers and cause a timeout. The spec says that for some request methods like GET, HEAD, DELETE, the request body, even if present, should be ignored, so for all practical purposes, there is no body. Thus it doesn't make sense to add a transfer-encoding: chunked. See this exact same bug raised and fixed for NodeJS: nodejs/node-v0.x-archive#6185.

As for our case, Pinterest API chokes on this. Here's a sample curl statement, where the access_token has been replaced with a fake one for obvious reasons.

curl -v -X DELETE -H "User-Agent: ReactorNetty/0.7.0.BUILD-SNAPSHOT" -H "Transfer-Encoding: chunked" -H "Accept-Encoding: gzip" -H "Accept: application/json" "https:/api.pinterest.com/v1/boards/sarkara1/test/?access_token=xxx"

The workaround for this is to set the header to null before making the request, which removes it from the header map. Needless to say, the workaround is ugly and shouldn't be required in the first place.


Affects: 5.0 RC3

Issue Links:

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions