GitHub user dosubot[bot] added a comment to the discussion: 400 Bad Request: The referrer does not match the host.
<!-- Answer --> To resolve the "400 Bad Request: The referrer does not match the host" error, follow these steps: 1. **Referer Header**: Ensure the 'Referer' header in your request matches the expected format. If your base URL is `https://dev.myurl.company.com`, the 'Referer' should be set to this exact URL. Double-check that the 'Referer' header in your request is correctly set to `https://dev.myurl.company.com`. 2. **CORS Configuration**: Verify your CORS settings in `superset_config.py`. Ensure that `CORS_OPTIONS` and `ALLOW_ORIGINS` include the correct URLs. The `origins` in `CORS_OPTIONS` should match the URLs you are using, such as `https://dev.myurl.company.com`. 3. **CSRF Token**: Make sure the CSRF token is correctly fetched from `/api/v1/security/csrf_token/` and included in the request headers as `X-CSRFToken`. This is crucial for request validation <sup>[[1]](https://github.com/apache/superset/discussions/31465)</sup>. 4. **TALISMAN and HTTP_HEADERS**: Since `TALISMAN_ENABLED` is set to `False`, ensure your `HTTP_HEADERS` configuration is correct. The `X-Frame-Options` and `Content-Security-Policy` should align with your intended security settings. Ensure that these headers do not conflict with your CORS settings. By ensuring these configurations are correct, you should be able to resolve the '400 Bad Request' error related to the 'Referer' header. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/2968eb05-9d32-405e-996f-b5d96832f4c4?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/2968eb05-9d32-405e-996f-b5d96832f4c4?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/2968eb05-9d32-405e-996f-b5d96832f4c4?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/2968eb05-9d32-405e-996f-b5d96832f4c4?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/2968eb05-9d32-405e-996f-b5d96832f4c4?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/2968eb05-9d32-405e-996f-b5d96832f4c4?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/2968eb05-9d32-405e-996f-b5d96832f4c4?feedback_type=other)</sup> GitHub link: https://github.com/apache/superset/discussions/33032#discussioncomment-12760369 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
