Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Middleware is skipped when i18n option is enabled #57759

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

Open
1 task done
mtsmfm opened this issue Oct 30, 2023 · 2 comments
Open
1 task done

Middleware is skipped when i18n option is enabled #57759

mtsmfm opened this issue Oct 30, 2023 · 2 comments
Labels
bug Issue was opened via the bug report template. Runtime Related to Node.js or Edge Runtime with Next.js. stale The issue has not seen recent activity.

Comments

@mtsmfm
Copy link

mtsmfm commented Oct 30, 2023

Link to the code that reproduces this issue

https://github.com/mtsmfm/nextjs-middleware-with-i18n

To Reproduce

$ WITH_I18N=true npm run dev
$ curl localhost:3000/ -I
HTTP/1.1 200 OK
Vary: RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Url, Accept-Encoding
Cache-Control: no-store, must-revalidate
X-Powered-By: Next.js
Content-Type: text/html; charset=utf-8
Date: Mon, 30 Oct 2023 13:21:21 GMT
Connection: keep-alive
Keep-Alive: timeout=5
$ curl localhost:3000/a -I
HTTP/1.1 307 Temporary Redirect
location: /home
Date: Mon, 30 Oct 2023 13:21:23 GMT
Connection: keep-alive
Keep-Alive: timeout=5

Current vs. Expected behavior

$ curl localhost:3000/ -I should return HTTP/1.1 307 Temporary Redirect

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP Fri Jan 27 02:56:13 UTC 2023
Binaries:
  Node: 20.9.0
  npm: 10.2.1
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.0.0
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.2.2
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Internationalization (i18n), Middleware / Edge (API routes, runtime)

Additional context

No response

@mtsmfm mtsmfm added the bug Issue was opened via the bug report template. label Oct 30, 2023
@github-actions github-actions bot added the Runtime Related to Node.js or Edge Runtime with Next.js. label Oct 30, 2023
@mtsmfm
Copy link
Author

mtsmfm commented Nov 1, 2023

I'm wondering if it can be a vulnerability if some auth logic is done by middleware.

@nextjs-bot
Copy link
Collaborator

This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.

@nextjs-bot nextjs-bot added the stale The issue has not seen recent activity. label Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Runtime Related to Node.js or Edge Runtime with Next.js. stale The issue has not seen recent activity.
Projects
None yet
Development

No branches or pull requests

2 participants