-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix: astro:env secret in middleware #12326
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
Closed
Closed
Changes from 4 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
6b92e0b
fix: astro:env secret in middleware
florian-lefebvre 9c03972
fix: do not emit file
florian-lefebvre 5ea167e
Update packages/astro/src/core/build/plugins/plugin-ssr.ts
florian-lefebvre cc891cc
Discard changes to packages/astro/test/env-secret.test.js
florian-lefebvre 08d3706
Discard changes to packages/astro/src/core/middleware/vite-plugin.ts
florian-lefebvre d1311e6
feat: import internal middleware directly
florian-lefebvre 11770f9
directly import internal middleware
florian-lefebvre bd35b98
feat: refine check
florian-lefebvre d96d2aa
feat: simplify
florian-lefebvre f329071
Merge branch 'main' into fix/env-secret-middleware
florian-lefebvre f29ee41
fix: test
florian-lefebvre 7f49c96
chore: changeset
florian-lefebvre 89d3908
feat: update middleware check
florian-lefebvre 931781b
feat: improve test
florian-lefebvre cd8f6ee
chore: add failing test for static pages
ematipico 36f3433
Update pipeline.ts
florian-lefebvre b675665
fix: test
florian-lefebvre 5a82302
feat: improve test adapter
florian-lefebvre 9b52c61
Merge branch 'main' into fix/env-secret-middleware
florian-lefebvre 46de5f7
feat: add back code
florian-lefebvre 27e83fe
fix: test
florian-lefebvre c17d691
Discard changes to packages/astro/src/core/build/plugins/plugin-pages.ts
florian-lefebvre 6bb6f1f
Update vite-plugin.ts
florian-lefebvre d984213
Update runtime.ts
florian-lefebvre 9eca2cb
Merge branch 'main' into fix/env-secret-middleware
florian-lefebvre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
7 changes: 7 additions & 0 deletions
7
packages/astro/test/fixtures/astro-env-server-secret/src/middleware.ts
This file contains hidden or 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,7 @@ | ||
| import { defineMiddleware } from 'astro/middleware'; | ||
| import { KNOWN_SECRET } from 'astro:env/server'; | ||
|
|
||
| export const onRequest = defineMiddleware(async (ctx, next) => { | ||
| console.log({ KNOWN_SECRET }); | ||
| return await next(); | ||
| }); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.