Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

cache_fetch: Send Content-Length: 0 for POST and PUT#4332

Closed
nigoroll wants to merge 1 commit intovarnishcache:masterfrom
nigoroll:post_put_cl0
Closed

cache_fetch: Send Content-Length: 0 for POST and PUT#4332
nigoroll wants to merge 1 commit intovarnishcache:masterfrom
nigoroll:post_put_cl0

Conversation

@nigoroll
Copy link
Copy Markdown
Member

otherwise keep the existing logic of sending no Content-Length header if there is no request body.

This code runs before vcl_backend_fetch, so should VCL gain back control over Content-Length as proposed in #4331, it will be possible again to override this default.

Fixes #4331 for the special case

@dridi
Copy link
Copy Markdown
Member

dridi commented May 16, 2025

See #4331 (comment).

In the absence of a bereq.body, I think we should rather strip content-length: 0 based on the method (when it is known not to anticipate data) and force the addition of content-length: 0 for other methods.

otherwise keep the existing logic of sending no Content-Length header if there
is no request body.

This code runs before vcl_backend_fetch, so should VCL gain back control over
Content-Length as proposed in varnishcache#4331, it will be possible again to override this
default.

Fixes varnishcache#4331 for the special case
@nigoroll
Copy link
Copy Markdown
Member Author

nigoroll commented Jun 2, 2025

Superseded by #4340

@nigoroll nigoroll closed this Jun 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

on removing content-length for 0-length POST requests

2 participants