-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor to build pages->headers map during
onPostBuild
- refactor `header-builder.ts` to loop through all possible pages/files and add their matching headers during `onPostBuild` - refactor `headers.ts` fastify plugin to look up headers for the path and add them, alongside default security, respecting overwrite precedence - add `reply.mode` and `reply.path` decorators to support adding headers to dynamic routes via the matched path rather than `request.url` - add tests to support feature table in #392, specifically: #392 (comment)
- Loading branch information
Showing
34 changed files
with
755 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file added
BIN
+202 KB
...in-fastify/src/__tests__/__files__/public/_gatsby/image/hash/hash/indonesia.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions
1
packages/gatsby-plugin-fastify/src/__tests__/__files__/public/app-hash.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log("Hello from app-hash.js"); |
1 change: 1 addition & 0 deletions
1
packages/gatsby-plugin-fastify/src/__tests__/__files__/public/component-fake-hash.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log("Hellow from component-fake-hash.js"); |
1 change: 1 addition & 0 deletions
1
packages/gatsby-plugin-fastify/src/__tests__/__files__/public/css-hash.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
body { border: 1px solid red; } |
1 change: 1 addition & 0 deletions
1
packages/gatsby-plugin-fastify/src/__tests__/__files__/public/fake-chunk.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log("Hello from fake-chunk.js"); |
2 changes: 1 addition & 1 deletion
2
packages/gatsby-plugin-fastify/src/__tests__/__files__/public/fake-lazycomponent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
console.log("this is a fake lazy component"); | ||
console.log("Hello from fake-lazycomponent.js"); |
1 change: 1 addition & 0 deletions
1
packages/gatsby-plugin-fastify/src/__tests__/__files__/public/page-data/app-data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"webpackCompilationHash":"cf2f9feb0b0d2002462c"} |
1 change: 1 addition & 0 deletions
1
...atsby-plugin-fastify/src/__tests__/__files__/public/page-data/posts/page-1/page-data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"componentChunkName":"component---src-pages-posts-page-1-js","path":"/posts/page-1/","result":{"pageContext":{}},"staticQueryHashes":[],"slicesMap":{}} |
1 change: 1 addition & 0 deletions
1
...atsby-plugin-fastify/src/__tests__/__files__/public/page-data/posts/page-2/page-data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"componentChunkName":"component---src-pages-posts-page-2-js","path":"/posts/page-2/","result":{"pageContext":{}},"staticQueryHashes":[],"slicesMap":{}} |
1 change: 1 addition & 0 deletions
1
...atsby-plugin-fastify/src/__tests__/__files__/public/page-data/posts/page-3/page-data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"componentChunkName":"component---src-pages-posts-page-3-js","path":"/posts/page-3/","result":{"pageContext":{}},"staticQueryHashes":[],"slicesMap":{}} |
File renamed without changes
Binary file added
BIN
+3.82 KB
packages/gatsby-plugin-fastify/src/__tests__/__files__/public/test.pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.