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

Not Working if Response Component Recreated by Module #20

Open
shyevsa opened this issue Oct 13, 2021 · 1 comment
Open

Not Working if Response Component Recreated by Module #20

shyevsa opened this issue Oct 13, 2021 · 1 comment

Comments

@shyevsa
Copy link

shyevsa commented Oct 13, 2021

Hello,

Thank you for creating this easy to use extension.

My Question are:
Do any reason (security implication or something else) on why the header need to be build in the Application event Application::EVENT_BEFORE_REQUEST

why not build it in the Response before send?

I have issue where I need to Change the Response Component on Modules.
in my use case I need different response class on subdomain modules.

My work around is extend the Headers class and attach the header building in Response::class instead on Application

Event::on(Response::class, Response::EVENT_BEFORE_SEND, function () { //build headers policy }

this is also use full when I need to dynamically build the CSP depending on the page.
like adding nonce or hash based on the script/css on the page.

@kasoft
Copy link

kasoft commented Sep 30, 2022

I also need to change CSP values dynamically. So this would be great!

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