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

don't try to inject nonce attributes into RedirectResponse content #1

Merged

Conversation

marcogrueter
Copy link

Great plugin, thank you very much for that!

When trying it out, I noticed that the redirect from Rainlabs translate plugin, in connection with the forceURLScheme setting, was visible on the page for a short time. I guess this is because the redirect is built during runtime and comes as a response to a page render.

Since RedirectResponses don't have anything to decorate anyway, it should be safe to just skip the nonce injection for this kind of content/response.

I am not 100% sure if it is a perfect solution, but it solves this problem.
There might be other kinds of content in the "dataHolder", but since the "normal" content is a string , I'm not sure if a reversed check (whitelisting content that should have nonce injected instead of blacklisting content like the RedirectResponse) is possible.

@tobias-kuendig
Copy link
Member

Very good point and great addition, thank you!

@tobias-kuendig tobias-kuendig merged commit 2d4be5d into OFFLINE-GmbH:master May 20, 2020
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.

None yet

2 participants