MCPcopy Create free account
hub / github.com/apache/trafficserver / XInjectResponseHeaders

Function XInjectResponseHeaders

plugins/xdebug/xdebug.cc:534–609  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

532}
533
534static int
535XInjectResponseHeaders(TSCont /* contp */, TSEvent event, void *edata)
536{
537 TSHttpTxn txn = static_cast<TSHttpTxn>(edata);
538 TSMBuffer buffer;
539 TSMLoc hdr;
540
541 TSReleaseAssert(event == TS_EVENT_HTTP_SEND_RESPONSE_HDR);
542
543 unsigned xheaders = AuxDataMgr::data(txn).xheaders;
544 if (xheaders == 0) {
545 goto done;
546 }
547
548 if (TSHttpTxnClientRespGet(txn, &buffer, &hdr) == TS_ERROR) {
549 goto done;
550 }
551
552 if (xheaders & XHEADER_X_CACHE_KEY) {
553 InjectCacheKeyHeader(txn, buffer, hdr);
554 }
555
556 if (xheaders & XHEADER_X_CACHE_INFO) {
557 InjectCacheInfoHeader(txn, buffer, hdr);
558 }
559
560 if (xheaders & XHEADER_X_CACHE) {
561 InjectCacheHeader(txn, buffer, hdr);
562 }
563
564 if (xheaders & XHEADER_X_MILESTONES) {
565 InjectMilestonesHeader(txn, buffer, hdr);
566 }
567
568 if (xheaders & XHEADER_X_GENERATION) {
569 InjectGenerationHeader(txn, buffer, hdr);
570 }
571
572 if (xheaders & XHEADER_X_TRANSACTION_ID) {
573 InjectTxnUuidHeader(txn, buffer, hdr);
574 }
575
576 if (xheaders & XHEADER_X_REMAP) {
577 InjectRemapHeader(txn, buffer, hdr);
578 }
579
580 if (xheaders & XHEADER_X_EFFECTIVE_URL) {
581 InjectEffectiveURLHeader(txn, buffer, hdr);
582 }
583
584 // intentionally placed after all injected headers.
585
586 if (xheaders & XHEADER_X_DUMP_HEADERS) {
587 log_headers(txn, buffer, hdr, "ClientResponse");
588 }
589
590 if (xheaders & XHEADER_X_PROBE_HEADERS) {
591 InjectOriginalContentTypeHeader(buffer, hdr);

Callers

nothing calls this directly

Calls 15

dataFunction · 0.85
TSHttpTxnClientRespGetFunction · 0.85
InjectCacheKeyHeaderFunction · 0.85
InjectCacheInfoHeaderFunction · 0.85
InjectCacheHeaderFunction · 0.85
InjectMilestonesHeaderFunction · 0.85
InjectGenerationHeaderFunction · 0.85
InjectTxnUuidHeaderFunction · 0.85
InjectRemapHeaderFunction · 0.85
InjectEffectiveURLHeaderFunction · 0.85
log_headersFunction · 0.85

Tested by

no test coverage detected