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

Persist session and cookies set on result #35

Merged
merged 2 commits into from
Apr 18, 2024

Conversation

andrew-nowak
Copy link
Member

Currently, in most code paths the filter constructs a new Result object with updated body and headers, which means that any new session or cookies previously set on the result will be dropped. The impact of this can currently be seen on the CV redact tool, which cannot pass CSRF checks because the session is never sent to the user's browser, so the CSRF token sent with the submission cannot be verified.

Instead, copy the Result to insert the updated headers and body without dropping other values set on the Result.

@mchv
Copy link
Member

mchv commented Apr 18, 2024

@andrew-nowak Sorry, I missed this notification!
I will have a look now

@mchv
Copy link
Member

mchv commented Apr 18, 2024

Thank you @andrew-nowak! I was curious about the issue and I found the following:

@mchv mchv merged commit 013c58c into guardian:main Apr 18, 2024
4 checks passed
@andrew-nowak andrew-nowak deleted the an/persist-new-session-cookies branch April 18, 2024 10:00
@mchv
Copy link
Member

mchv commented Apr 18, 2024

I have just shipped 0.15.2 with the fix.

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

Successfully merging this pull request may close these issues.

2 participants