-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[gatsby-plugin-netlify] Overwrite headers #8020
Comments
Hi @NeoLegends, you can remove the default security headers by passing mergeSecurityHeaders as |
Ah, I was thinking the opposite. mergeSecurityHeaders implies that it will do the merge for me. Might wanna rename that. :)
… Am 10.09.2018 um 13:51 schrieb Darpan Kakadia ***@***.***>:
Closed #8020.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@NeoLegends doesn't it implies that if it's value is |
I thought it would overwrite the defaults with my config values. |
I know this is closed, but I spent some time on this as well. This is a not a merge but more of a "concat" of headers if you ask me. It doesn't feel intuitive as it currently stands. Are you open for changes on this? |
would also expect to be able to override default security headers |
I have also just run into this. Felt more intuitive that setting a value and merging would override the default, not create a duplicate |
Just ran into this too, the current behavior is indeed an append and not a merge as it should be. |
@antoinerousseau That does make sense. Happy to accept a PR! |
@NeoLegends have you figured out a solution for this? I am getting an error |
I have the following in my config and trying to allow anything with the root URL public.tableau.com
However, I am still getting the same error and not sure if my set up is correct. |
|
I had a similar use case - wanted to use a gatsby site page in an iframe on another site. I had a really hard time getting all the various methods listed above (config etc.) working with Netlify, even though I'm pretty sure I followed everything correctly. It may have been a version issue somewhere with one of the npm packages, but it kept overwriting the headers I'd set. I ended up just deploying the app to vercel and it worked; thankfully (for this case at least), vercel doesn't add the |
If you share your versions and code I can have a look. I made a PR on the Gatsby Netlify plugin a few months ago to fix these issues and it got merged, so now it works for me for the same use case. |
Description
I was trying to override the
X-Frame-Options: DENY
-header the plugin sets for all pages to enable a headless CMS to embed our page in an iframe.Steps to reproduce
Taken from https://github.com/BILDQUADRAT/website.
Set headers like this:
gatsby-config.js
:Expected result
I'd end up with a
_headers
file like this:Actual result
I get a
_headers
file like this:The
transformHeaders
-function allowed me to reach my desired result, but it's not a very elegant solution.Environment
The text was updated successfully, but these errors were encountered: