Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access to XMLHttpRequest at 'https://events.launchdarkly.com/events/bulk/6374af9a71e138110cdb10cd' from origin 'https://localhost:5001' has been blocked by CORS policy: Request header field request-context is not allowed by Access-Control-Allow-Headers in preflight response. #295

Closed
ptldanielthompson opened this issue Nov 15, 2023 · 6 comments
Labels
waiting for feedback Indicates LaunchDarkly is waiting for customer feedback before issue is closed due to staleness.

Comments

@ptldanielthompson
Copy link

ptldanielthompson commented Nov 15, 2023

I am getting this error in my console logs and its being sent to AppInsights it does not seem to effect the running of my launch darkly features. Just curious if there is anything I need to do to stop it

Access to XMLHttpRequest at 'https://events.launchdarkly.com/events/bulk/6374af9a71e138110cdb10cd' from origin 'https://localhost:5001' has been blocked by CORS policy: Request header field request-context is not allowed by Access-Control-Allow-Headers in preflight response.

It also happens in production not just my localhost development

"launchdarkly-react-client-sdk": "^3.0.9",
@kinyoklion
Copy link
Member

Hello @ptldanielthompson,

This is going to affect the analytics and other features in the UI of LaunchDarkly. Information like context attributes, or data for experimentation, are delivered through this mechanism.

It soulds like something is adding a "request-context" header to the event payloads. This isn't something that the LaunchDarkly SDK does, and isn't a header that our endpoints accept.

I am not familiar with ApplicationInsights, but if its usage involves an SDK, then it may be that it is modifying requests to incorporate this header (from some searching it seems like it may be related to a cross origin correlations feature). Things like this sometimes happen with various APM tools.

So, first I would see if the issue goes away if you don't use ApplicationInsights locally. If it does, then you can work from that to determine how to prevent ApplicationInsights from modifying LaunchDarkly requests.

Thank you,
Ryan

@kinyoklion kinyoklion added the waiting for feedback Indicates LaunchDarkly is waiting for customer feedback before issue is closed due to staleness. label Nov 27, 2023
@gdp2
Copy link

gdp2 commented Apr 3, 2024

Hoping for an update as I am facing the same issue

@kinyoklion
Copy link
Member

Hello @gdp2,

Currently there is no activity or anticipated activity for this ticket. As the SDK does not add a "request-context" to any headers. So identifying the code that is adding that header is the correct course of action.

Are you using azure/asp/appinsights? It seems like this functionality may be controlled by "RequestTrackingTelemetryModule" or some app insights configuration file.

If this header is required, then please contact our support. Reference this thread so they have context. Our endpoints do not accept that header, so there isn't anything the SDK can do.

Thanks,
Ryan

@ptldanielthompson
Copy link
Author

Thank you for the heads up. Its given me a new direction to search for a fix. I appreciate the answer.

@gdp2
Copy link

gdp2 commented Apr 3, 2024

ease contact our support. Reference this t

I am using Dynatrace for user monitoring.It adds some custom headers(x-dtpc,x-dtReferer) to launchdarkly's bulk api.

@prabusampath007
Copy link

@ptldanielthompson, how did you fixed this issue? Can you please share the solution, we're also facing the similar kind of issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for feedback Indicates LaunchDarkly is waiting for customer feedback before issue is closed due to staleness.
Projects
None yet
Development

No branches or pull requests

4 participants