Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove Request-Context from Response Header

Somehow in my request response header "Request-Context" coming and i tried to remove that using in web.config and Response.Headers.Remove("Request-Context"); in global.asax but that header is not getting removed.

In the value of that header I am getting some Appid and I am not sure from where that is coming.

Here is response header of my request.

Cache-Control:no-cache, no-store
Content-Encoding:gzip 
Content-Length:140 
Content-Type:application/json; charset=utf-8 
Date:Tue, 20 Feb 2018 09:48:28 GMT
Pragma:no-cache
Request-Context:appId=cid-v1:b650ed48-297a-4ea2-af46-0a5a5d26a82b
Vary:Accept-Encoding

Any help appreciated. Thanks in Advance.

like image 721
Deepak Kumar Avatar asked Oct 31 '25 15:10

Deepak Kumar


1 Answers

Request-Context is used for cross-component correlation when 2 of your applications use different instrumentation keys.

In this case, knowing caller or callee appId (passed in the header) allows to build application map and trace correlated telemetry across instrumentation keys

You may set RequestTrackingTelemetryModule.SetComponentCorrelationHttpHeaders to false to prevent header to be added to the response. You can do it in applicationInsights xml file, just find RequestTrackingTelemetryModule element and add <SetComponentCorrelationHttpHeaders>false</SetComponentCorrelationHttpHeaders> under it.

Refer link: https://github.com/Microsoft/ApplicationInsights-dotnet-server/issues/739#issuecomment-367774652

like image 75
Deepak Kumar Avatar answered Nov 04 '25 03:11

Deepak Kumar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!