-
Couldn't load subscription status.
- Fork 10.3k
Open
Labels
status: triage neededIssue or pull request that need to be triaged and assigned to a reviewerIssue or pull request that need to be triaged and assigned to a reviewertype: bugAn issue or pull request relating to a bug in GatsbyAn issue or pull request relating to a bug in Gatsby
Description
Preliminary Checks
- This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/gatsbyjs/gatsby/issues
- This issue is not a question, feature request, RFC, or anything other than a bug report directly related to Gatsby. Please post those things in GitHub Discussions: https://github.com/gatsbyjs/gatsby/discussions
Description
The gatsby-adapter-netlify is not generating HTTP headers defined in gatsby-config if the route is a redirect route.
Redirect routes support headers as defined in IRedirectRoute.
Based on this comment this appears to be functionality that is not yet implemented but with no "stock" way to "opt-out" of the netlify adapter when building and running on Netlify, this should likely be addressed sooner than later.
Reproduction Link
Steps to Reproduce
- Go to repro on codesandbox
- View the
publicfolder and open _headers file - There is no header for the path
/testpage, however other headers fromgatsby-configare present
To re-create the scenario:
- Run
cleantask - Run
buildtask - View
_headersfile inpublicfolder
Expected Result
A X-PageName header should be defined in _headers for the route /testpage
/testpage/
X-PageName: TestPage
Actual Result
The X-PageName header for /testpage is not in the _headers file.
Environment
System:
OS: Linux 6.1 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
CPU: (2) x64 AMD EPYC
Shell: 5.1.4 - /bin/bash
Binaries:
Node: 18.17.1 - ~/.local/state/fnm_multishells/2521_1694238260312/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 9.6.7 - ~/.local/state/fnm_multishells/2521_1694238260312/bin/npm
npmPackages:
gatsby: ^5.8.1 => 5.12.4
gatsby-adapter-netlify: ^1.0.0 => 1.0.0Config Flags
N/A
Metadata
Metadata
Assignees
Labels
status: triage neededIssue or pull request that need to be triaged and assigned to a reviewerIssue or pull request that need to be triaged and assigned to a reviewertype: bugAn issue or pull request relating to a bug in GatsbyAn issue or pull request relating to a bug in Gatsby