Closed AcidWeb closed 3 months ago
I'm not sure if it's supposed to work that way, but enabling CORS change HTTP return code to always return 200.
import { AutoRouter, cors, error } from 'itty-router' const { preflight, corsify } = cors() const router = AutoRouter({ before: [preflight], finally: [corsify], }) router.get('/', () => error(404)) export default { ...router }
Request should return 404.
Request return 200.
Definitely not the intended behavior - thanks for catching that!
Starting the tests now~
Confirmed, will have a fix out momentarily!
Released as 5.0.6 just now :)
5.0.6
Thanks again for the catch!
Describe the Issue
I'm not sure if it's supposed to work that way, but enabling CORS change HTTP return code to always return 200.
Example Router Code
Steps to Reproduce
Expected Behavior
Request should return 404.
Actual Behavior
Request return 200.
Environment: