Skip to content

Commit 630a14c

Browse files
committed
Fix.
1 parent 55afd78 commit 630a14c

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

deno.lock

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

handleRequest.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const contentTypes = {
1515
export async function handleRequest(request: Request) {
1616
const url = new URL(request.url);
1717
const atSignIndex = url.pathname.lastIndexOf("@");
18-
if (atSignIndex >= 0 && url.pathname.length - atSignIndex === 64) {
18+
if (atSignIndex >= 0 && url.pathname.length - atSignIndex === 65) {
1919
return redirectWithoutHash(url, atSignIndex);
2020
}
2121
const newUrl = await resolvePluginOrSchemaUrl(url);
@@ -167,5 +167,6 @@ function create404Response() {
167167
}
168168

169169
function redirectWithoutHash(url: URL, atSignIndex: number) {
170-
return Response.redirect(url.pathname.slice(0, atSignIndex) + url.search + url.hash, 302);
170+
const newUrl = new URL(url.pathname.slice(0, atSignIndex) + url.search + url.hash, url);
171+
return createRedirectResponse(newUrl.toString());
171172
}

0 commit comments

Comments
 (0)