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


##########
proxy/http/HttpTransact.cc:
##########
@@ -7834,7 +7834,13 @@ HttpTransact::build_response(State *s, HTTPHdr 
*base_response, HTTPHdr *outgoing
                              HTTPStatus status_code, const char *reason_phrase)
 {
   if (reason_phrase == nullptr) {
-    reason_phrase = http_hdr_reason_lookup(status_code);
+    if (status_code != HTTP_STATUS_NONE) {
+      reason_phrase = http_hdr_reason_lookup(status_code);
+      Debug("http_transact", "Using reason phrase from status %d: %s", 
status_code, reason_phrase);
+    } else if (base_response->status_get() != HTTP_STATUS_NONE) {

Review Comment:
   We may want to check the availability of `base_response`, although it 
doesn't make sense if it has `nullptr` on this line.



-- 
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