Applicationinsights-js: Disable correlation id header for a specific domain

Created on 27 Sep 2018  路  3Comments  路  Source: microsoft/ApplicationInsights-JS

Hi,
An iframe of a payment provider is trying to do an cross-domain request. When doing so it fails with the following error:
Failed to load https://checkoutshopper-test.adyen.com/checkoutshopper/services/PaymentInitiation/v1/initiate?token=pub.v2.821...: Request header field Request-Id is not allowed by Access-Control-Allow-Headers in preflight response.

Also seen in the Network tab:

image

This is happening within an Azure Web App.

to my understanding, Application Insights adds these request-id's. I am able to disable this on the backend following this blog: https://blog.wille-zone.de/post/disable-application-insights-correlation-id-headers-on-httpclient-requests-in-aspnet-core/

How do I do this in the front-end? Angular 5 application to be specific.

Most helpful comment

Figured I had to use `correlationHeaderExcludedDomains

instrumentationKey: '80b3fe90-7aef-4dce-90c6-0ee09ceb2eab',
                    cookieDomain: "mybabywatcher.com",
                    enableCorsCorrelation: true,
                    correlationHeaderExcludedDomains: [
                       '*.adyen.com'
                    ]

All 3 comments

Figured I had to use `correlationHeaderExcludedDomains

instrumentationKey: '80b3fe90-7aef-4dce-90c6-0ee09ceb2eab',
                    cookieDomain: "mybabywatcher.com",
                    enableCorsCorrelation: true,
                    correlationHeaderExcludedDomains: [
                       '*.adyen.com'
                    ]

Figured I had to use `correlationHeaderExcludedDomains

instrumentationKey: '80b3fe90-7aef-4dce-90c6-0ee09ceb2eab',
                    cookieDomain: "mybabywatcher.com",
                    enableCorsCorrelation: true,
                    correlationHeaderExcludedDomains: [
                       '*.adyen.com'
                    ]

Thanks much.

Add a related issue today were the wild card alone didn't work. I had to add strictly type the urls in order for it work properly.

instrumentationKey: '80b3fe90-7aef-4dce-90c6-0ee09ceb2eab',
                    cookieDomain: "mybabywatcher.com",
                    enableCorsCorrelation: true,
                    correlationHeaderExcludedDomains: [
                       '*.adyen.com',
                        '*.adyen.com/core.js'
                        '*.adyen.com/service.js'
                        '*.adyen.com/ui.js'
                    ]
Was this page helpful?
0 / 5 - 0 ratings