-
-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What version of Elysia is running?
Bun: 1.0.18, Elysia: Elysia --revision fails but it's a fresh installation as of 12/12/2024
What platform is your computer?
Darwin 23.5.0 arm64 arm
What steps can reproduce the bug?
import { Elysia } from "elysia";
import { cors } from "@elysiajs/cors";
const app = new Elysia()
.use(cors({ origin: 'localhost:4200' }))
.post("/test", req => req.body)
.listen(3000);What is the expected behavior?
I expected only requests coming from localhost:4200 to be allowed.
What do you see instead?
For some reason, the origin must be passed in as an array. ['localhost:4200'] works, but the other types (regex, true) listed in the documentation do not. I understand true would allow all traffic and wouldn't be suitable for this purpose anyway, but I just want to point out that this also isn't functioning.
Additional information
No response
Have you try removing the node_modules and bun.lockb and try again yet?
It was a brand new project specifically for illustrating this bug
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working