Open mrctrifork opened 3 months ago
Eden lowercases headers right before sending them over the wire.
This is apparently fine due to HTTP 1.1 says header names ought to be case insensitive.
The problem comes when you define a schema for your headers in Elysia. Let's assume the following example:
export const app = new Elysia() .get( '/headers-uppercased', ({ headers, headers: { username, alias } }) => ({ username, alias, authorization: headers.Authorization }), { headers: t.Object({ username: t.String(), alias: t.Literal('Kristen'), Authorization: t.Optional(t.Literal('Bearer token')) }) } )
This example fails as, of course, Eden will lowercase the Authorization header and therefore the schema validator will expect an Uppercased Authorization header.
Eden lowercases headers right before sending them over the wire.
This is apparently fine due to HTTP 1.1 says header names ought to be case insensitive.
The problem comes when you define a schema for your headers in Elysia. Let's assume the following example:
This example fails as, of course, Eden will lowercase the Authorization header and therefore the schema validator will expect an Uppercased Authorization header.