Closed bogeychan closed 1 month ago
1.1.4
WSL Ubuntu
// index.ts import { Elysia, t } from "elysia"; const app = new Elysia() .guard({ cookie: t.Cookie({ session: t.String() }), }) .get("/", ({ cookie: { session } }) => session.value ? session.value : "Empty" ) .listen(5000); let response = await app.handle(new Request(`${app.server!.url}`)); console.log(await response.text()); response = await app.handle( new Request(`${app.server!.url}`, { headers: { Cookie: "session=value" } }) ); console.log(await response.text()); app.stop();
bun run index.ts
Console output:
{ "type": "validation", "on": "cookie", "property": "/session", "message": "Expected required property", "expected": { "session": "" }, "found": {}, "errors": [ { "type": 45, "schema": { "type": "string" }, "path": "/session", "message": "Expected required property" }, { "type": 54, "schema": { "type": "string" }, "path": "/session", "message": "Expected string" } ] } value
Empty value
This used to work back in version 1.0.27
1.0.27
reported on discord
Not sure what happens but couldn't replicate on 1.1.7
Closing this as it is working again in the latest version
What version of Elysia.JS is running?
1.1.4
What platform is your computer?
WSL Ubuntu
What steps can reproduce the bug?
What is the expected behavior?
Console output:
What do you see instead?
Console output:
Additional information
This used to work back in version
1.0.27
reported on discord