-
Notifications
You must be signed in to change notification settings - Fork 96
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
X-Frame-Options always set to deny #549
Comments
Hey @louishuyng, many thanks for this. I think it definitely makes sense to normalize the strings to lower or uppercase before comparing them here. Would you be happy to open a PR with your suggested change? |
@allmarkedup here is the PR for that: #554. I guess it just small changes there is enough for fixing this issue |
@louishuyng merged now :) Many thanks for your time on this, much appreciated. |
@louishuyng I am getting an error now when I upgraded to 2.20 |
@adrienpoly could you help to contribute for that. I believe we just simply check nil for that before calling upcase method headers["X-Frame-Options"]&.upcase == "DENY" |
I will test it, I am pretty sure your proposal should fix it |
@louishuyng yes it does fix the issue |
I opened #561 to fix that |
Describe the bug
In the line where I debug, there is a condition
headers["X-Frame-Options"] == "DENY"
. To changeheaders["X-Frame-Options"]
back to"SAMEORIGIN"
The condition can not run because the value of
headers["X-Frame-Options"]
is in lowercase value"deny"
Source code: https://github.dev/ViewComponent/lookbook/blob/main/app/controllers/lookbook/previews_controller.rb
To Reproduce
Steps to reproduce the behavior:
I think we can add some changes like below to prevent this bug happening
From:
headers["X-Frame-Options"] == "DENY"
To:
headers["X-Frame-Options"].downcase == "deny"
Expected behavior
It should set
headers["X-Frame-Options"]
to "SAMEORIGIN"Screenshots
Version numbers
Please complete the following information:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: