TSHttpIsInternalRequest¶
Test whether a request is internally-generated.
Synopsis¶
#include <ts/ts.h>
- TSReturnCode TSHttpIsInternalRequest(TSHttpTxn txnp) InkAPI.cc line 7404¶
- TSReturnCode TSHttpIsInternalSession(TSHttpSsn ssnp) InkAPI.cc line 7388¶
Description¶
TSHttpIsInternalRequest() tests whether a HTTP transaction was originated within Traffic Server.
TSHttpIsInternalSession() tests whether a HTTP session was originated within Traffic Server.
Return Values¶
Both these APIs returns a TSReturnCode, indicating whether the object was internal (TS_SUCCESS) or not (TS_ERROR).
Examples¶
The ESI plugin uses TSHttpIsInternalRequest() to ignore requests that is had generated while fetching portions of an ESI document:
if (TSHttpIsInternalRequest(txnp) != TS_SUCCESS) {
TSDebug(DEBUG_TAG, "[%s] Skipping external request", __FUNCTION__);
return false;
}
See also¶
TSAPI(3ts)