Open
Description
What version of Elysia is running?
1.1.26
What platform is your computer?
Microsoft Windows NT 10.0.19045.0 x64
What steps can reproduce the bug?
I found this issue when I tried parsing the ISO8601 string with a positive timezone.
The following reproduce code is a little bit diffrent from the test-case which is at
elysia/test/validator/query.test.ts
Line 684 in 9ab72e8
import Elysia, { t } from "elysia";
const api = new Elysia().get("", ({ query }) => query, {
query: t.Object({
keyword: t.String(),
}),
});
const url = new URL("http://localhost:3000/");
url.searchParams.append("keyword", "hello+world");
console.log(url.href); // http://localhost:3000/?keyword=hello%2Bworld
const result = await api
.handle(new Request(url.href))
.then((response) => response.json());
console.log(result);
/*
{
keyword: "hello world", // Should be "hello+world"
}
*/
What is the expected behavior?
When sending the "%2B", should return "+"
What do you see instead?
As downgrading to 1.1.25, the behavier is as expected, which returns a "+".
Additional information
No response
Have you try removing the node_modules
and bun.lockb
and try again yet?
No response