Skip to content

Cloudflare page will always get 405 error for non-GET method #787

Description

@DanSnow

Environment

Nitro: v1.0.0
Node: v16.18.1

Reproduction

repo: https://github.com/DanSnow/nitro-bug
Cloudflare Page: https://nitro-bug.pages.dev

  1. create an API event handler
  2. use POST request to the event handler
  3. will get 405 method not allow error

Describe the bug

I think it's because here only test 404 error, but Cloudflare will respond 405 if the method is not GET here
https://github.com/unjs/nitro/blob/main/src/runtime/entries/cloudflare-pages.ts#L25

Additional context

No response

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions