Mostly so that it's easier to cut the next patch release for Fresh.
This reverts commit e3508c3054.
This commit is contained in:
@@ -273,42 +273,6 @@ Deno.test("no open redirect when passing double slashes", async () => {
|
||||
assertEquals(resp.headers.get("location"), "/evil.com");
|
||||
});
|
||||
|
||||
Deno.test("ctx.redirect() - relative urls", async () => {
|
||||
let resp = await handler(
|
||||
new Request("https://fresh.deno.dev/redirect?path=//evil.com/"),
|
||||
);
|
||||
assertEquals(resp.status, 302);
|
||||
assertEquals(resp.headers.get("location"), "/evil.com/");
|
||||
|
||||
resp = await handler(
|
||||
new Request(
|
||||
"https://fresh.deno.dev/redirect?path=//evil.com//foo&status=307",
|
||||
),
|
||||
);
|
||||
assertEquals(resp.status, 307);
|
||||
assertEquals(resp.headers.get("location"), "/evil.com/foo");
|
||||
});
|
||||
|
||||
Deno.test("ctx.redirect() - absolute urls", async () => {
|
||||
const resp = await handler(
|
||||
new Request("https://fresh.deno.dev/redirect?path=https://example.com/"),
|
||||
);
|
||||
assertEquals(resp.status, 302);
|
||||
assertEquals(resp.headers.get("location"), "https://example.com/");
|
||||
});
|
||||
|
||||
Deno.test("ctx.redirect() - with search and hash", async () => {
|
||||
const resp = await handler(
|
||||
new Request(
|
||||
`https://fresh.deno.dev/redirect?path=${
|
||||
encodeURIComponent("/foo/bar?baz=123#foo")
|
||||
}`,
|
||||
),
|
||||
);
|
||||
assertEquals(resp.status, 302);
|
||||
assertEquals(resp.headers.get("location"), "/foo/bar?baz=123#foo");
|
||||
});
|
||||
|
||||
Deno.test("/failure", async () => {
|
||||
const resp = await handler(new Request("https://fresh.deno.dev/failure"));
|
||||
assert(resp);
|
||||
@@ -1205,7 +1169,6 @@ Deno.test("Expose config in ctx", async () => {
|
||||
next: "Function",
|
||||
render: "AsyncFunction",
|
||||
renderNotFound: "AsyncFunction",
|
||||
redirect: "Function",
|
||||
localAddr: "<undefined>",
|
||||
pattern: "/ctx_config",
|
||||
data: "<undefined>",
|
||||
|
||||
Reference in New Issue
Block a user