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

500 error on invalid paths for cached event handlers #2657

Open
cjpearson opened this issue Aug 13, 2024 · 0 comments
Open

500 error on invalid paths for cached event handlers #2657

cjpearson opened this issue Aug 13, 2024 · 0 comments

Comments

@cjpearson
Copy link
Contributor

cjpearson commented Aug 13, 2024

Environment

Node v20.9.0, [email protected]

Reproduction

https://stackblitz.com/edit/github-qj829h?file=server%2Froutes%2Findex.ts

Describe the bug

For a cached event handler, sending a request an invalidly encoded path will cause a 500 error. This is similar to #717. I would expect either a 404 error or for nitro to ignore the invalid path.

Additional context

No response

Logs

[nitro] [request error] [unhandled] URI malformed
  at decodeURI (<anonymous>)
  at getKey (./.nitro/dev/index.mjs:305:35)
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async ./.nitro/dev/index.mjs:273:17
  at async Object.handler (./.nitro/dev/index.mjs:461:22)
  at async ./node_modules/h3/dist/index.mjs:1975:19
  at async Object.callAsync (./node_modules/unctx/dist/index.mjs:72:16)
  at async Server.toNodeHandle (./node_modules/h3/dist/index.mjs:2266:7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant