bneradt commented on code in PR #12520:
URL: https://github.com/apache/trafficserver/pull/12520#discussion_r2354085004
##########
plugins/header_rewrite/resources.cc:
##########
@@ -52,16 +52,16 @@ Resources::gather(const ResourceIDs ids, TSHttpHookID hook)
switch (hook) {
case TS_HTTP_READ_RESPONSE_HDR_HOOK:
// Read response headers from server
- if (ids & RSRC_SERVER_RESPONSE_HEADERS) {
+ if ((ids & RSRC_SERVER_RESPONSE_HEADERS) || (ids & RSRC_RESPONSE_STATUS)) {
Dbg(pi_dbg_ctl, "\tAdding TXN server response header buffers");
if (TSHttpTxnServerRespGet(state.txnp, &bufp, &hdr_loc) != TS_SUCCESS) {
Dbg(pi_dbg_ctl, "could not gather bufp/hdr_loc for response");
return;
}
- }
- if (ids & RSRC_RESPONSE_STATUS) {
- Dbg(pi_dbg_ctl, "\tAdding TXN server response status resource");
- resp_status = TSHttpHdrStatusGet(bufp, hdr_loc);
+ if (ids & RSRC_RESPONSE_STATUS) {
+ Dbg(pi_dbg_ctl, "\tAdding TXN server response status resource");
+ resp_status = TSHttpHdrStatusGet(bufp, hdr_loc);
Review Comment:
Note that this call to TSHttpHdrStatusGet will need TSHttpTxnServerRespGet
to have been called to populate bufp/hdr_loc. This change ensures that.
--
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]