Skip to content

Commit

Permalink
decode
Browse files Browse the repository at this point in the history
  • Loading branch information
KATT committed Apr 30, 2024
1 parent d207027 commit 2c13b76
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Expand Up @@ -182,7 +182,7 @@ export async function resolveResponse<TRouter extends AnyRouter>(
try {
info = getRequestInfo({
req,
path: opts.path,
path: decodeURIComponent(opts.path),
config: router._def._config,
searchParams: url.searchParams,
});
Expand Down
14 changes: 14 additions & 0 deletions packages/tests/server/adapters/fetch.test.ts
Expand Up @@ -277,3 +277,17 @@ test('mutation', async () => {

await t.close();
});

test('batching', async () => {
const t = await startServer();

const normalResult = await (
await fetch(`${t.url}/hello,foo?batch=1&input={}`)
).json();
const comma = '%2C';
const urlEncodedResult = await (
await fetch(`${t.url}/hello${comma}foo?batch=1&input={}`)
).json();

expect(normalResult).toEqual(urlEncodedResult);
});

0 comments on commit 2c13b76

Please sign in to comment.