vercel/next.js

POST request succeeds for pages with next dev

Open

#38,863 创建于 2022年7月21日

在 GitHub 查看
 (6 评论) (0 反应) (0 负责人)JavaScript (139,471 star) (31,066 fork)batch import
buggood first issuelinear: next

描述

Verify canary release

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

Provide environment information

Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:22 PDT 2022; root:xnu-8020.121.3~4/RELEASE_X86_64
Binaries:
  Node: 16.14.0
  npm: 8.12.0
  Yarn: 1.22.17
  pnpm: 7.5.2
Relevant packages:
  next: 12.2.3-canary.15
  eslint-config-next: 12.2.2
  react: 18.2.0
  react-dom: 18.2.0

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

When you send a POST request to a page running with next dev, it succeeds with 200 status even though it fails with 405 status when running with next start

Expected Behavior

Non-GET/HEAD requests fail with 405 status code in the same way with next start

Link to reproduction

https://github.com/vercel/next.js/tree/canary/examples

To Reproduce

$ next dev

# on another terminal
$ curl http://localhost:3000 -X POST -v

The problem should happen on any apps.

贡献者指南