Open binamralamsal opened 3 months ago
I am not sure if it's related but when I have separate UI and backend, CORS error is occuring if cookies are altered.
Same issue here for WSL, on elysia 1.1.13.
Also, it seems it works fine on aot: false
case
Minimal reproduction example:
import Elysia from 'elysia';
export const app = new Elysia({
cookie: { secrets: 'secret', sign: ['session'] },
})
.onError(({ error }) => {
console.log(error);
return {};
})
.get('', ({ cookie: { session } }) => {
console.log(session);
})
.listen(3000);
console.log('listening on port 3000');
Other errors prints the error and return {}
as response
But when try sending request with cookie session=1234
, error is not caught at all
What version of Elysia.JS is running?
1.0.26
What platform is your computer?
Microsoft Windows NT 10.0.22631.0 x64
What steps can reproduce the bug?
What is the expected behavior?
When cookies have been altered, it should respond with the format
{ error: "...", status: "ERROR" }
What do you see instead?
I am just getting raw text when cookies have been altered. onError is not getting called.
Additional information
No response