Dealing with CORS Issues for Godot Engine

Learn how to allow Sentry trace headers on requests from Godot Web exports to your backend.

If your Web game calls a backend on another origin, adding tracing headers can cause the browser to block the request unless the backend allows them. For example, a game at https://game.example.com calling https://api.example.com needs the backend's permission to make that cross-origin request.

Configure your backend's CORS headers to allow sentry-trace and baggage:

Copied
Access-Control-Allow-Headers: sentry-trace, baggage

The exact server configuration depends on your setup.

If you enable propagate_traceparent, also allow that header:

Copied
Access-Control-Allow-Headers: sentry-trace, baggage, traceparent

If you've restricted trace propagation targets, make sure they include your backend URL. SentryHTTPRequest automatically adds tracing headers to matching requests. For custom instrumentation, pass the request URL to SentrySpan.get_trace_headers(url) and add the returned headers to the request.

Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").