elysiajs / elysia

Ergonomic Framework for Humans
https://elysiajs.com
MIT License
10.64k stars 226 forks source link

Make CORS-safelisted response headers upper case by default to work out of the box with `Access-Control-Allow-Headers` #847

Closed bogeychan closed 1 month ago

bogeychan commented 2 months ago

What version of Elysia is running?

1.1.16

What platform is your computer?

WSL Ubuntu

What steps can reproduce the bug?

image

new Elysia().get("/", () => "lower case content-type").listen(3000);

image

What is the expected behavior?

to have all these headers upper case by default: CORS-safelisted

maybe switch behaviour and make all upper case

What do you see instead?

Additional information

For more details: https://github.com/elysiajs/elysia-cors/issues/48#issuecomment-2371926760

Have you try removing the node_modules and bun.lockb and try again yet?

yes

SaltyAom commented 1 month ago

According to RFC 2616, header field is case-INsensitive which means either case should work just fine.

Each header field consists of a name followed by a colon (":") and the field value. Field names are case-insensitive

So, in my opinion, it's unlikely that we would make a (soft) breaking change for that