maskit commented on code in PR #9877:
URL: https://github.com/apache/trafficserver/pull/9877#discussion_r1237359022


##########
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 (!(s->source == SOURCE_CACHE && header->status_get() == 
HTTP_STATUS_NO_CONTENT)) {

Review Comment:
   Having different behavior for the two sources (origin server and cache) 
doesn't make sense to me. The document in cache is originally from an origin 
server and it's just cached. If we removed the header only when we serve a 
document from cache, a client would see inconsistent responses that depend on 
the cache status. So, yes, I think we should check only the status code.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to