ApplicationInsights-JS icon indicating copy to clipboard operation
ApplicationInsights-JS copied to clipboard

[BUG] Response and request headers not sent in telemetry from non-Electron browsers

Open scottcmg opened this issue 2 months ago • 0 comments

Description/Screenshot When running from Chrome, Edge and Safari headers for requests and responses are not getting sent by the SDK to App Insights (confirmed by inspecting traces using Fiddler). When running from an Electron-based browser, the headers are getting sent.

Besides the missing header data and the browser type there's no other differences in the telemetry that is sent.

Steps to Reproduce

  • OS/Browser: Tested on MacOS Sequoia 15.7.1 and Windows 11 version 10.0.26100 build 26100
  • SDK Version [e.g. 22]: @microsoft/[email protected]
  • How you initialized the SDK:
import { ApplicationInsights } from "@microsoft/applicationinsights-web";

const appInsights = new ApplicationInsights({
 config: {
   connectionString: "string",
   enableCorsCorrelation: true,
   enableRequestHeaderTracking: true,
   enableResponseHeaderTracking: true
 }
});

appInsights.loadAppInsights();

// Custom telemetry initializer for additional context
appInsights.addTelemetryInitializer((envelope) => {
 if (envelope.baseType === "RemoteDependencyData") {
   if (envelope.data) {
     envelope.data.CustomField = info.customField;
     // ... other custom properties
   }
 }
});

Expected behavior Request and response headers are sent to App Insights from any browser.

Additional context Add any other context about the problem here.

scottcmg avatar Oct 21 '25 23:10 scottcmg