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

The CSRF header name needs to be configurable #1190

Open
vegaed opened this issue Jun 12, 2024 · 2 comments
Open

The CSRF header name needs to be configurable #1190

vegaed opened this issue Jun 12, 2024 · 2 comments

Comments

@vegaed
Copy link

vegaed commented Jun 12, 2024

We use a different header name than X-CSRFToken and causes testing via swagger-ui to fail against our api.

Either use the django setting or provide a way to override.

Code in question is

req.headers['X-CSRFToken'] = "{{csrf_token}}";

@Speedy1991
Copy link

Speedy1991 commented Jun 14, 2024

You can just overwrite this template with your own template in ninja/templates/ninja/swagger_cdn.html and add your custom logic (e.g. access your settings)

@vegaed
Copy link
Author

vegaed commented Jun 14, 2024

@Speedy1991 I have added my own template and its not pulling from it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants