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

FormKey issues (URLs without / at the end) #1541

Open
DevYevhen opened this issue Jul 5, 2019 · 0 comments
Open

FormKey issues (URLs without / at the end) #1541

DevYevhen opened this issue Jul 5, 2019 · 0 comments

Comments

@DevYevhen
Copy link

DevYevhen commented Jul 5, 2019

FormKey ESI Response gets cached with wrong access settings (and served to all users) if router was changed to generate URLs without / at the end. (/turpentine/esi/getFormKey/ttl//method/esi/scope/global/access/private)
Symptoms are:

  • all forms with formkey stops to work (formkey error) if any other user requested a page with any form earlier.

  • you can see the same formkey for different users, but any other ESI block content are differ.

req.http.X-Varnish-Esi-Access calculation regex awaits URL with / at the end. If / is absent, then req.http.X-Varnish-Esi-Access would be wrong and vcl_hash will not add frontend cookie to hash calculation. Original regex:

set req.http.X-Varnish-Esi-Access = regsub(
                req.url, ".*/{{esi_cache_type_param}}/(\w+)/.*", "\1");

could be changed to something like that:

set req.http.X-Varnish-Esi-Access = regsub(
                req.url, ".*/{{esi_cache_type_param}}/(\w+)(/|\z).*", "\1");

to resolve issue.

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

1 participant