fix: don't change scheme on redirect (#1024)

Fixes #1015

This scenario can happen when a user has a proxy sitting in front of
Fresh, that does TLS termination, while Fresh is running on plain text
HTTP.

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
This commit is contained in:
Luca Casonato
2023-05-25 18:40:40 +10:00
committed by GitHub
co-authored by Asher Gomez
parent 1a456444e4
commit f95f7586f5
2 changed files with 12 additions and 20 deletions
+3 -3
View File
@@ -199,7 +199,7 @@ Deno.test("redirect /pages/fresh/ to /pages/fresh", async () => {
assertEquals(resp.status, Status.TemporaryRedirect);
assertEquals(
resp.headers.get("location"),
"https://fresh.deno.dev/pages/fresh",
"/pages/fresh",
);
});
@@ -211,7 +211,7 @@ Deno.test("redirect /pages/////fresh///// to /pages/////fresh", async () => {
assertEquals(resp.status, Status.TemporaryRedirect);
assertEquals(
resp.headers.get("location"),
"https://fresh.deno.dev/pages/////fresh",
"/pages/////fresh",
);
});
@@ -223,7 +223,7 @@ Deno.test("redirect /pages/////fresh/ to /pages/////fresh", async () => {
assertEquals(resp.status, Status.TemporaryRedirect);
assertEquals(
resp.headers.get("location"),
"https://fresh.deno.dev/pages/////fresh",
"/pages/////fresh",
);
});