elysiajs / elysia

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

Cookie Schema doesn't work in instances #681

Open itzRolf opened 3 weeks ago

itzRolf commented 3 weeks ago

What version of Elysia.JS is running?

1.0.23

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What steps can reproduce the bug?

import { Elysia, t } from "elysia";

const controller = new Elysia().get("/", () => "Hello Elysia", {
  cookie: t.Object({
    "auth": t.String()
  })
})

const app = new Elysia().use(controller);

// app.listen(3100); localhost:3100 = Hello Elysia
controller.listen(3100); // localhost:3100 = 422. Required property

What is the expected behavior?

In both cases cookies must be required

What do you see instead?

When I use controller with use, cookie schema doesn't work

Additional information

No response