Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions doc/admin-guide/logging/formatting.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ Status Codes
.. _cfsc:
.. _csssc:
.. _pfsc:
.. _prscs:
.. _pssc:
.. _sssc:
.. _prrp:
Expand All @@ -699,6 +700,14 @@ pfsc Proxy Request Finish status code specifying whether the proxy
(``INTR``), or timed out (``TIMEOUT``).
prrp Proxy Response HTTP response reason phrase sent by |TS| proxy to the
client.
prscs Proxy Response The identifying label for the entity (such as a plugin
name or component) that last set the HTTP status code
for the transaction. This is set via
:func:`TSHttpTxnStatusSet` with a ``setter`` parameter
or :func:`TSHttpHdrStatusSet` with a ``setter``
parameter. Shows ``-`` if no setter has been recorded.
``ip_allow`` will be set if the :file:`ip_allow.yaml`
component denies the request.
pssc Proxy Response HTTP response status code sent by |TS| proxy to the
client.
sssc Origin Response HTTP response status code sent by the origin server
Expand Down
15 changes: 15 additions & 0 deletions doc/developer-guide/api/functions/TSHttpHdrStatusSet.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,20 @@ Synopsis

.. function:: TSReturnCode TSHttpHdrStatusSet(TSMBuffer bufp, TSMLoc offset, TSHttpStatus status)

.. function:: TSReturnCode TSHttpHdrStatusSet(TSMBuffer bufp, TSMLoc offset, TSHttpStatus status, TSHttpTxn txnp, std::string_view setter)

Description
===========

Sets the HTTP status code on an existing HTTP header object. An overload also
accepts the transaction and an identifying setter label. When provided, the
setter is recorded on the transaction for logging via the `prscs` log field.

Parameters
==========

- bufp: Marshal buffer containing the HTTP header.
- offset: Location of the HTTP header within bufp.
- status: The HTTP status code to set.
- txnp: Optional transaction handle on which to record the setter label.
- setter: Optional label identifying the component setting the status; pass empty to leave unchanged.
67 changes: 67 additions & 0 deletions doc/developer-guide/api/functions/TSHttpTxnStatusSet.en.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
.. Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed
with this work for additional information regarding copyright
ownership. The ASF licenses this file to you under the Apache
License, Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing
permissions and limitations under the License.

.. include:: ../../../common.defs

.. default-domain:: cpp

TSHttpTxnStatusSet
******************

Synopsis
========

.. code-block:: cpp

#include <ts/ts.h>

.. function:: void TSHttpTxnStatusSet(TSHttpTxn txnp, TSHttpStatus status)

.. function:: void TSHttpTxnStatusSet(TSHttpTxn txnp, TSHttpStatus status, std::string_view setter)

Description
===========

:func:`TSHttpTxnStatusSet` sets the transaction's internal status state, which triggers
Traffic Server's error handling system. This is typically used for access control,
authentication failures, and early transaction processing. Traffic Server will
automatically generate an appropriate error response body.

:arg:`txnp` is the associated transaction for the new status.

:arg:`status` is the HTTP status code to set.

:arg:`setter` (overload) is an optional identifying label for the entity setting the status
(e.g., plugin name), used for logging purposes. The setter information can be retrieved
using the 'prscs' log field. If empty, does not change the current setter value.
Defaults to empty string.

This function is commonly used by plugins that need to terminate a transaction early
with an error status. Unlike :func:`TSHttpHdrStatusSet`, this function affects the
transaction state rather than just the HTTP headers.

The ``setter`` parameter provides a convenient way to track which component set the status
for debugging and logging purposes.

Return Values
=============

:func:`TSHttpTxnStatusSet` returns no value.

See Also
========

:manpage:`TSHttpHdrStatusSet(3ts)`
2 changes: 1 addition & 1 deletion example/plugins/c-api/basic_auth/basic_auth.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ handle_response(TSHttpTxn txnp)
goto done;
}

TSHttpHdrStatusSet(bufp, hdr_loc, TS_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED);
TSHttpHdrStatusSet(bufp, hdr_loc, TS_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED, txnp, PLUGIN_NAME);
TSHttpHdrReasonSet(bufp, hdr_loc, TSHttpHdrReasonLookup(TS_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED),
strlen(TSHttpHdrReasonLookup(TS_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED)));

Expand Down
2 changes: 1 addition & 1 deletion example/plugins/c-api/denylist_0/denylist_0.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ handle_response(TSHttpTxn txnp)
goto done;
}

TSHttpHdrStatusSet(bufp, hdr_loc, TS_HTTP_STATUS_FORBIDDEN);
TSHttpHdrStatusSet(bufp, hdr_loc, TS_HTTP_STATUS_FORBIDDEN, txnp, PLUGIN_NAME);
TSHttpHdrReasonSet(bufp, hdr_loc, TSHttpHdrReasonLookup(TS_HTTP_STATUS_FORBIDDEN),
strlen(TSHttpHdrReasonLookup(TS_HTTP_STATUS_FORBIDDEN)));

Expand Down
2 changes: 1 addition & 1 deletion example/plugins/c-api/denylist_1/denylist_1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ handle_response(TSHttpTxn txnp, TSCont contp ATS_UNUSED)
goto done;
}

TSHttpHdrStatusSet(bufp, hdr_loc, TS_HTTP_STATUS_FORBIDDEN);
TSHttpHdrStatusSet(bufp, hdr_loc, TS_HTTP_STATUS_FORBIDDEN, txnp, PLUGIN_NAME);
TSHttpHdrReasonSet(bufp, hdr_loc, TSHttpHdrReasonLookup(TS_HTTP_STATUS_FORBIDDEN),
strlen(TSHttpHdrReasonLookup(TS_HTTP_STATUS_FORBIDDEN)));

Expand Down
2 changes: 1 addition & 1 deletion example/plugins/c-api/redirect_1/redirect_1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ handle_response(TSHttpTxn txnp)
goto done;
}

TSHttpHdrStatusSet(bufp, hdr_loc, TS_HTTP_STATUS_MOVED_PERMANENTLY);
TSHttpHdrStatusSet(bufp, hdr_loc, TS_HTTP_STATUS_MOVED_PERMANENTLY, txnp, PLUGIN_NAME);
TSHttpHdrReasonSet(bufp, hdr_loc, TSHttpHdrReasonLookup(TS_HTTP_STATUS_MOVED_PERMANENTLY),
strlen(TSHttpHdrReasonLookup(TS_HTTP_STATUS_MOVED_PERMANENTLY)));

Expand Down
2 changes: 1 addition & 1 deletion example/plugins/c-api/remap/remap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo *rri)

len = snprintf(tmp, 255, "This is very small example of TS API usage!\nIteration %d!\nHTTP return code %d\n", my_local_counter,
TS_HTTP_STATUS_CONTINUE + my_local_counter);
TSHttpTxnStatusSet(rh, static_cast<TSHttpStatus>(static_cast<int>(TS_HTTP_STATUS_CONTINUE) + my_local_counter));
TSHttpTxnStatusSet(rh, static_cast<TSHttpStatus>(static_cast<int>(TS_HTTP_STATUS_CONTINUE) + my_local_counter), PLUGIN_NAME);
TSHttpTxnErrorBodySet(rh, tmp, len, nullptr); // Defaults to text/html
my_local_counter++;
}
Expand Down
2 changes: 1 addition & 1 deletion example/plugins/c-api/secure_link/secure_link.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo *rri)
}
if (sli->strict) {
Dbg(dbg_ctl, "request is DENY");
TSHttpTxnStatusSet(rh, TS_HTTP_STATUS_FORBIDDEN);
TSHttpTxnStatusSet(rh, TS_HTTP_STATUS_FORBIDDEN, PLUGIN_NAME);
status = TSREMAP_NO_REMAP;
} else {
Dbg(dbg_ctl, "request is PASS");
Expand Down
3 changes: 2 additions & 1 deletion include/proxy/http/HttpTransact.h
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,8 @@ class HttpTransact
HTTPVersion updated_server_version = HTTP_INVALID;
CacheLookupResult_t cache_lookup_result = CacheLookupResult_t::NONE;
HTTPStatus http_return_code = HTTPStatus::NONE;
CacheAuth_t www_auth_content = CacheAuth_t::NONE;
std::string http_return_code_setter_name;
CacheAuth_t www_auth_content = CacheAuth_t::NONE;

Arena arena;

Expand Down
1 change: 1 addition & 0 deletions include/proxy/logging/LogAccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ class LogAccess
int marshal_proxy_resp_squid_len(char *); // INT
int marshal_proxy_resp_content_len(char *); // INT
int marshal_proxy_resp_status_code(char *); // INT
int marshal_status_plugin_entry(char *); // STR
int marshal_proxy_resp_header_len(char *); // INT
int marshal_proxy_finish_status_code(char *); // INT
int marshal_cache_result_code(char *); // INT
Expand Down
33 changes: 32 additions & 1 deletion include/ts/ts.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#endif

#include <type_traits>
#include <string_view>
#include <vector>

#include "tsutil/DbgCtl.h"
Expand Down Expand Up @@ -1142,7 +1143,9 @@ TSReturnCode TSHttpHdrUrlGet(TSMBuffer bufp, TSMLoc offset, TSMLoc *locp);
TSReturnCode TSHttpHdrUrlSet(TSMBuffer bufp, TSMLoc offset, TSMLoc url);

TSHttpStatus TSHttpHdrStatusGet(TSMBuffer bufp, TSMLoc offset);
/** This is a candidate for deprecation in v10.0.0 in favor of the version that takes the setter. */
TSReturnCode TSHttpHdrStatusSet(TSMBuffer bufp, TSMLoc offset, TSHttpStatus status);
TSReturnCode TSHttpHdrStatusSet(TSMBuffer bufp, TSMLoc offset, TSHttpStatus status, TSHttpTxn txnp, std::string_view setter);
const char *TSHttpHdrReasonGet(TSMBuffer bufp, TSMLoc offset, int *length);
TSReturnCode TSHttpHdrReasonSet(TSMBuffer bufp, TSMLoc offset, const char *value, int length);
const char *TSHttpHdrReasonLookup(TSHttpStatus status);
Expand Down Expand Up @@ -1637,7 +1640,35 @@ TSReturnCode TSUserArgIndexLookup(TSUserArgType type, int arg_idx, const char **
void TSUserArgSet(void *data, int arg_idx, void *arg);
void *TSUserArgGet(void *data, int arg_idx);

void TSHttpTxnStatusSet(TSHttpTxn txnp, TSHttpStatus status);
/** Set the HTTP status code for a transaction.
*
* Sets the transaction's internal status state, triggering Traffic Server's
* error handling system. This is typically used for access control,
* authentication failures, and early transaction processing. Traffic Server
* will automatically generate an appropriate error response body.
*
* @note This is a candidate for deprecation in v10.0.0 in favor of the version
* that takes the setter.
*
* @param[in] txnp The associated transaction for the new status.
* @param[in] status The HTTP status code to set.
*/
void TSHttpTxnStatusSet(TSHttpTxn txnp, TSHttpStatus status);

/** Set the HTTP status code for a transaction and track the entity that set it.
*
* Sets the transaction's internal status state, triggering Traffic Server's
* error handling system. This is typically used for access control,
* authentication failures, and early transaction processing. Traffic Server
* will automatically generate an appropriate error response body.
*
* @param[in] txnp The associated transaction for the new status.
* @param[in] status The HTTP status code to set.
* @param[in] setter Identifying label for the entity setting the status
* (e.g., plugin name). If empty, clears the current setter information.
*/
void TSHttpTxnStatusSet(TSHttpTxn txnp, TSHttpStatus status, std::string_view setter);

TSHttpStatus TSHttpTxnStatusGet(TSHttpTxn txnp);

void TSHttpTxnActiveTimeoutSet(TSHttpTxn txnp, int timeout);
Expand Down
2 changes: 1 addition & 1 deletion plugins/authproxy/authproxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ StateUnauthorized(AuthRequestContext *auth, void *)
{
static const char msg[] = "authorization denied\n";

TSHttpTxnStatusSet(auth->txn, TS_HTTP_STATUS_FORBIDDEN);
TSHttpTxnStatusSet(auth->txn, TS_HTTP_STATUS_FORBIDDEN, "authproxy");
TSHttpTxnErrorBodySet(auth->txn, TSstrdup(msg), sizeof(msg) - 1, TSstrdup("text/plain"));

TSHttpTxnReenable(auth->txn, TS_EVENT_HTTP_ERROR);
Expand Down
10 changes: 5 additions & 5 deletions plugins/experimental/access_control/plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ handleInvalidToken(TSHttpTxn txnp, AccessControlTxnData *data, bool reject, cons
{
TSRemapStatus resultStatus = TSREMAP_NO_REMAP;
if (reject) {
TSHttpTxnStatusSet(txnp, httpStatus);
TSHttpTxnStatusSet(txnp, httpStatus, PLUGIN_NAME);
resultStatus = TSREMAP_DID_REMAP;
} else {
data->_vaState = status;
Expand Down Expand Up @@ -395,7 +395,7 @@ contHandleAccessControl(const TSCont contp, TSEvent event, void *edata)
} else {
AccessControlDebug("failed to construct a valid origin access token, did not set-cookie with it");
/* Don't set any cookie, fail the request here returning appropriate status code and body.*/
TSHttpTxnStatusSet(txnp, config->_invalidOriginResponse);
TSHttpTxnStatusSet(txnp, config->_invalidOriginResponse, PLUGIN_NAME);
static const char *body = "Unexpected Response From the Origin Server\n";
size_t bufsize = strlen(body) + 1;
char *buf = static_cast<char *>(TSmalloc(bufsize));
Expand Down Expand Up @@ -602,18 +602,18 @@ TSRemapDoRemap(void *instance, TSHttpTxn txnp, TSRemapRequestInfo *rri)
}
}
} else {
TSHttpTxnStatusSet(txnp, config->_invalidRequest);
TSHttpTxnStatusSet(txnp, config->_invalidRequest, PLUGIN_NAME);
AccessControlDebug("https is the only allowed scheme (plugin should be used only with TLS)");
remapStatus = TSREMAP_DID_REMAP;
}
} else {
TSHttpTxnStatusSet(txnp, config->_internalError);
TSHttpTxnStatusSet(txnp, config->_internalError, PLUGIN_NAME);
AccessControlError("failed to get request uri-scheme");
remapStatus = TSREMAP_DID_REMAP;
}
} else {
/* Something is terribly wrong, we cannot get the configuration */
TSHttpTxnStatusSet(txnp, TS_HTTP_STATUS_INTERNAL_SERVER_ERROR);
TSHttpTxnStatusSet(txnp, TS_HTTP_STATUS_INTERNAL_SERVER_ERROR, PLUGIN_NAME);
AccessControlError("configuration unavailable");
remapStatus = TSREMAP_DID_REMAP;
}
Expand Down
8 changes: 4 additions & 4 deletions plugins/experimental/cookie_remap/cookie_remap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1217,18 +1217,18 @@ TSRemapDoRemap(void *ih, TSHttpTxn txnp, TSRemapRequestInfo *rri)
// Maybe set the return status
if (status > TS_HTTP_STATUS_NONE) {
Dbg(dbg_ctl, "Setting return status to %d", status);
TSHttpTxnStatusSet(txnp, status);
TSHttpTxnStatusSet(txnp, status, MY_NAME);
if ((status == TS_HTTP_STATUS_MOVED_PERMANENTLY) || (status == TS_HTTP_STATUS_MOVED_TEMPORARILY)) {
if (rewrite_to.size() > 8192) {
TSError("Redirect in target "
"URL too long");
TSHttpTxnStatusSet(txnp, TS_HTTP_STATUS_REQUEST_URI_TOO_LONG);
TSHttpTxnStatusSet(txnp, TS_HTTP_STATUS_REQUEST_URI_TOO_LONG, MY_NAME);
} else {
const char *start = rewrite_to.c_str();
int dest_len = rewrite_to.size();

if (TS_PARSE_ERROR == TSUrlParse(rri->requestBufp, rri->requestUrl, &start, start + dest_len)) {
TSHttpTxnStatusSet(txnp, TS_HTTP_STATUS_INTERNAL_SERVER_ERROR);
TSHttpTxnStatusSet(txnp, TS_HTTP_STATUS_INTERNAL_SERVER_ERROR, MY_NAME);
TSError("can't parse "
"substituted "
"URL string");
Expand All @@ -1251,7 +1251,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn txnp, TSRemapRequestInfo *rri)

// set the new url
if (TSUrlParse(rri->requestBufp, rri->requestUrl, &start, start + rewrite_to.length()) == TS_PARSE_ERROR) {
TSHttpTxnStatusSet(txnp, TS_HTTP_STATUS_INTERNAL_SERVER_ERROR);
TSHttpTxnStatusSet(txnp, TS_HTTP_STATUS_INTERNAL_SERVER_ERROR, MY_NAME);
TSError("can't parse substituted URL string");
goto error;
} else {
Expand Down
2 changes: 1 addition & 1 deletion plugins/experimental/geoip_acl/geoip_acl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo *rri)

if (!a->eval(rri, rh)) {
Dbg(dbg_ctl, "denying request");
TSHttpTxnStatusSet(rh, static_cast<TSHttpStatus>(403));
TSHttpTxnStatusSet(rh, static_cast<TSHttpStatus>(403), PLUGIN_NAME);
a->send_html(rh);
}
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/experimental/http_stats/http_stats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo * /* rri ATS_UNUSED */

if (!cfg) {
VERROR("No remap context available, check code / config");
TSHttpTxnStatusSet(rh, TS_HTTP_STATUS_INTERNAL_SERVER_ERROR);
TSHttpTxnStatusSet(rh, TS_HTTP_STATUS_INTERNAL_SERVER_ERROR, PLUGIN);
return TSREMAP_NO_REMAP;
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/experimental/icap/icap_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ handle_invalid_icap_behavior(TSCont contp, TransformData *data, const char *msg)
TSError("[%s] Couldn't clear client response header", PLUGIN_NAME);
return 0;
}
TSHttpHdrStatusSet(bufp, hdr_loc, TS_HTTP_STATUS_BAD_GATEWAY);
TSHttpHdrStatusSet(bufp, hdr_loc, TS_HTTP_STATUS_BAD_GATEWAY, data->txn, PLUGIN_NAME);
TSHttpHdrReasonSet(bufp, hdr_loc, TSHttpHdrReasonLookup(TS_HTTP_STATUS_BAD_GATEWAY),
strlen(TSHttpHdrReasonLookup(TS_HTTP_STATUS_BAD_GATEWAY)));
TSHandleMLocRelease(bufp, TS_NULL_MLOC, hdr_loc);
Expand Down
2 changes: 1 addition & 1 deletion plugins/experimental/maxmind_acl/maxmind_acl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn rh, TSRemapRequestInfo *rri)
Acl *a = static_cast<Acl *>(ih);
if (!a->eval(rri, rh)) {
Dbg(dbg_ctl, "denying request");
TSHttpTxnStatusSet(rh, TS_HTTP_STATUS_FORBIDDEN);
TSHttpTxnStatusSet(rh, TS_HTTP_STATUS_FORBIDDEN, PLUGIN_NAME);
a->send_html(rh);
}
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/experimental/mp4/mp4.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ TSRemapDoRemap(void * /* ih ATS_UNUSED */, TSHttpTxn rh, TSRemapRequestInfo *rri
return TSREMAP_NO_REMAP;

} else if (start < 0) {
TSHttpTxnStatusSet(rh, TS_HTTP_STATUS_BAD_REQUEST);
TSHttpTxnStatusSet(rh, TS_HTTP_STATUS_BAD_REQUEST, DEBUG_TAG);
TSHttpTxnErrorBodySet(rh, TSstrdup("Invalid request."), sizeof("Invalid request.") - 1, nullptr);
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/experimental/rate_limit/rate_limit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn txnp, TSRemapRequestInfo * /* rri ATS_UNUSED
case ReserveStatus::HIGH_RATE:
if (!limiter->max_queue() || limiter->full()) {
// We are running at limit, and the queue has reached max capacity, give back an error and be done.
TSHttpTxnStatusSet(txnp, static_cast<TSHttpStatus>(limiter->error()));
TSHttpTxnStatusSet(txnp, static_cast<TSHttpStatus>(limiter->error()), PLUGIN_NAME);
limiter->setupTxnCont(txnp, TS_HTTP_SEND_RESPONSE_HDR_HOOK);
Dbg(dbg_ctl, "Rejecting request, we're at %s and queue is full", status == ReserveStatus::FULL ? "capacity" : "high rate");
} else {
Expand Down
2 changes: 1 addition & 1 deletion plugins/experimental/rate_limit/txn_limiter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ txn_queue_cont(TSCont cont, TSEvent /* event ATS_UNUSED */, void * /* edata ATS_

delayHeader(txnp, limiter->header(), age);
Dbg(dbg_ctl, "Queued TXN is too old (%ldms), erroring out", static_cast<long>(age.count()));
TSHttpTxnStatusSet(txnp, static_cast<TSHttpStatus>(limiter->error()));
TSHttpTxnStatusSet(txnp, static_cast<TSHttpStatus>(limiter->error()), PLUGIN_NAME);
TSHttpTxnHookAdd(txnp, TS_HTTP_SEND_RESPONSE_HDR_HOOK, contp);
limiter->incrementMetric(RATE_LIMITER_METRIC_EXPIRED);
TSHttpTxnReenable(txnp, TS_EVENT_HTTP_ERROR);
Expand Down
2 changes: 1 addition & 1 deletion plugins/experimental/tls_bridge/tls_bridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ Bridge::update_ua_response()
// an actual upstream connection. Otherwise, let the original connection response code
// ride.
if (_out_response_code != TS_HTTP_STATUS_OK && _out_response_code != TS_HTTP_STATUS_NONE) {
TSHttpHdrStatusSet(mbuf, hdr_loc, _out_response_code);
TSHttpHdrStatusSet(mbuf, hdr_loc, _out_response_code, _ua_txn, PLUGIN_NAME);
if (!_out_response_reason.empty()) {
TSHttpHdrReasonSet(mbuf, hdr_loc, _out_response_reason.data(), _out_response_reason.size());
}
Expand Down
Loading