Skip to content
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

Add edge-functions/modify-request-header example #429

Merged
merged 3 commits into from Nov 21, 2022

Conversation

nuta
Copy link
Contributor

@nuta nuta commented Oct 21, 2022

Description

Adds an example for vercel/next.js#41380, which adds a support for adding/updating/deleting request headers in middlewares.

Demo URL

https://seiya-modify-request-header.vercel.app/

Will also add this app to Vercel Examples after merging this.

Type of Change

  • New Example
  • Example updates (Bug fixes, new features, etc.)
  • Other (changes to the codebase, but not to examples)

New Example Checklist

  • 🛫 npm run new-example was used to create the example
  • 📚 The template wasn't used but I carefuly read the Adding a new example steps and implemented them in the example
  • 📱 Is it responsive? Are mobile and tablets considered?

Notes

@vercel/examples-ui's Nav causes the hydration mismatch error in canary:

Error: Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.
Learn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor

@vercel
Copy link

vercel bot commented Oct 21, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
edge-ab-testing-google-optimize ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
edge-ab-testing-statsig ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
edge-functions-ab-testing-simple ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
edge-functions-bot-protection-datadome ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
edge-functions-cookies ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
edge-functions-feature-flag-configcat ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
edge-functions-feature-flag-posthog ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
edge-functions-feature-flag-split ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
edge-functions-ip-blocking-datadome ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
edge-functions-jwt-authentication ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
edge-functions-power-parity-pricing-strategies ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
feature-flag-optimizely ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
mint-nft ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
solutions-cms-contentstack-commerce ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
solutions-combining-data-fetching-strategies ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
solutions-image-fallback ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
solutions-microfrontends ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
solutions-microfrontends-docs ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
solutions-monorepo ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
solutions-testing ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
static-tweets-tailwind ❌ Failed (Inspect) Nov 21, 2022 at 5:02AM (UTC)
52 Ignored Deployments
Name Status Preview Updated
build-output-api-edge-functions ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
build-output-api-edge-middleware ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
build-output-api-image-optimization ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
build-output-api-isr ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
build-output-api-overrides ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
build-output-api-prerender-functions ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
build-output-api-preview-mode ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
build-output-api-routes ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
build-output-api-serverless-functions ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
build-output-api-static-files ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
build-output-api-wildcard ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
domains-api ⬜️ Ignored (Inspect) Nov 21, 2022 at 5:02AM (UTC)
edge-api-routes-cache-control ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-api-routes-hello-world ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-api-routes-json-response ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-api-routes-query-parameters ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-functions-add-header ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-functions-api-rate-limit ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-functions-api-rate-limit-and-tokens ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-functions-authed-proxy ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-functions-basic-auth-password ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-functions-bot-protection-botd ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-functions-cors ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-functions-crypto ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-functions-geolocation ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-functions-hostname-rewrites ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-functions-i18n ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-functions-image-response ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-functions-ip-blocking ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-functions-json-response ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-functions-news ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-functions-power-parity-pricing ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-functions-query-params-filter ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-functions-redirects-upstash ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-functions-streams ⬜️ Ignored (Inspect) Nov 21, 2022 at 5:02AM (UTC)
edge-maintenance-page ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-rewrites-upstash ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
edge-user-agent-based-rendering ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
example-auth-with-ory ⬜️ Ignored (Inspect) Nov 21, 2022 at 5:02AM (UTC)
example-feature-flag-apple-store ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
example-reduce-image-bandwidth-usage ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
i18n ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
solutions-image-offset ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
solutions-loading-web-fonts ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
solutions-on-demand-isr ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
solutions-pagination-with-ssg ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
solutions-reuse-responses ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
solutions-script-component-ad ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
solutions-script-component-strategies ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
solutions-subdomains-auth ⬜️ Ignored (Inspect) Visit Preview Nov 21, 2022 at 5:02AM (UTC)
wasm-rust-hello-world ⬜️ Ignored (Inspect) Nov 21, 2022 at 5:02AM (UTC)
wasm-rust-xor ⬜️ Ignored (Inspect) Nov 21, 2022 at 5:02AM (UTC)

@nuta nuta changed the title Add edge-functions/modify-request-header Add edge-functions/modify-request-header example Oct 21, 2022
@nuta nuta merged commit f886bb6 into main Nov 21, 2022
@nuta nuta deleted the edge-functions-add-request-header-example branch November 21, 2022 07:26
nuta added a commit that referenced this pull request Nov 21, 2022
This broke "Publish Templates" presumably because it's missing in Contentful.

This PR reverts it for now to fix the workflow.

This reverts commit f886bb6.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants