Skip to content

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

@scottcmg

Description

@scottcmg

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/applicationinsights-web@3.3.8
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions