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

Passing CSRF token in header not working on NGINX server, as underscores in header are not supported #178

Closed
JordanRifaey opened this issue Feb 2, 2024 · 6 comments

Comments

@JordanRifaey
Copy link

@blizzz @akrabat regarding this PR to enable csrf token check in http header: #175

It seems that the CSRF keys have an underscore in them, and NGINX does not support underscores in headers. Is there any way to customize the csrf keys so we can remove the underscore?

@blizzz
Copy link
Contributor

blizzz commented Feb 2, 2024

Ok, so that is what @deployHuman referred to in #143 (comment)

return $this->prefix . '_name';
and
return $this->prefix . '_value';
would need to be changed.

@akrabat
Copy link
Member

akrabat commented Jun 8, 2024

This needs addressing, but as it's a BC break, we'll need to roll a 2.0 for it I think.

Until then, you can add:

underscores_in_headers on

to your nginx config as per https://nginx.org/en/docs/http/ngx_http_core_module.html#underscores_in_headers

@deployHuman
Copy link
Contributor

hehe yeah my first PR got little to no love, i think i was too bad at describing what problem i had stumbled on.
Now tho, i have moved on long time ago, a problem cant take 3 years to fix ^^
I think its a warning-sign on how active this repo is :D

All good whishes from me tho! take care

@akrabat
Copy link
Member

akrabat commented Jun 8, 2024

a problem cant take 3 years to fix

I agree. Catching Covid back in 2021 has proven to be challenging for some of us and the team is very small. No excuses, it's just where it is at.

@deployHuman
Copy link
Contributor

Putting no blame on you!
Remember its still open source.
And we recently saw what a difficult position it is to be a owner of a repo from that whole "XZ-trust-attack" news
hope you and everyone fully recover and take care!
Much love from Sweden
/G

@akrabat
Copy link
Member

akrabat commented Jun 8, 2024

Fixed in #186.

@akrabat akrabat closed this as completed Jun 8, 2024
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

4 participants