bneradt commented on code in PR #12679:
URL: https://github.com/apache/trafficserver/pull/12679#discussion_r2547530841
##########
src/proxy/http/HttpSM.cc:
##########
@@ -2059,14 +2059,20 @@ HttpSM::state_read_server_response_header(int event,
void *data)
}
// fallthrough
- case ParseResult::DONE:
-
+ case ParseResult::DONE: {
if (!t_state.hdr_info.server_response.check_hdr_implements()) {
t_state.http_return_code = HTTPStatus::BAD_GATEWAY;
call_transact_and_set_next_state(HttpTransact::BadRequest);
break;
}
+ // Recompute cooked cache control with targeted headers (pass nullptr if
not configured).
+ const char *targeted_headers =
+ (t_state.txn_conf->targeted_cache_control_headers &&
t_state.txn_conf->targeted_cache_control_headers[0] != '\0') ?
+ t_state.txn_conf->targeted_cache_control_headers :
+ nullptr;
+ t_state.hdr_info.server_response.m_mime->recompute_cooked_stuff(nullptr,
targeted_headers);
+
Review Comment:
This is the other interesting production change (part 2).
This is "recooked" here to avoid intermingling the targeted cache control
configuration into the MIME/parser interface. The recompute should be cheap, so
I think this is OK. But if wanted, I can look into trying to get the parse to
happen initially at parse_resp.
--
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]