This is an automated email from the ASF dual-hosted git repository.
maskit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 327a003045 Do not add content-length for status 204 cache (#9877)
327a003045 is described below
commit 327a003045f4019a9ebdc4ed7400e5b824297cf2
Author: Hiroaki Nakamura <[email protected]>
AuthorDate: Thu Jun 22 06:33:28 2023 +0900
Do not add content-length for status 204 cache (#9877)
* Do not add content-length for status 204 cache
* Do not add content-length when proxying status 204 response too
---
proxy/http/HttpTransact.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 7753db9508..f2e6dfae5b 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -6748,7 +6748,9 @@ HttpTransact::handle_content_length_header(State *s,
HTTPHdr *header, HTTPHdr *b
change_response_header_because_of_range_request(s, header);
s->hdr_info.trust_response_cl = true;
} else {
- header->set_content_length(cl);
+ if (header->status_get() != HTTP_STATUS_NO_CONTENT) {
+ header->set_content_length(cl);
+ }
s->hdr_info.trust_response_cl = true;
}
} else {