Skip to content

Commit d5f294d

Browse files
add test case for + character and query string
1 parent 0d9927d commit d5f294d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

packages/tests-unit/tests/core/routing/matcher.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,24 @@ describe("handleRedirects", () => {
266266

267267
expect(result).toBeUndefined();
268268
});
269+
270+
it("should redirect with + character and query string", () => {
271+
const event = createEvent({
272+
url: "/foo",
273+
});
274+
275+
const result = handleRedirects(event, [
276+
{
277+
source: "/foo",
278+
destination: "/search?bar=hello+world&baz=new%2C+earth",
279+
internal: true,
280+
statusCode: 308
281+
},
282+
]);
283+
284+
expect(result.statusCode).toEqual(308);
285+
expect(result.headers.Location).toEqual("/search?bar=hello+world&baz=new%2C+earth");
286+
});
269287
});
270288

271289
describe("handleRewrites", () => {

0 commit comments

Comments
 (0)