Skip to content

Commit

Permalink
Fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Jun 24, 2023
1 parent 55afd78 commit 630a14c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 9 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions handleRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const contentTypes = {
export async function handleRequest(request: Request) {
const url = new URL(request.url);
const atSignIndex = url.pathname.lastIndexOf("@");
if (atSignIndex >= 0 && url.pathname.length - atSignIndex === 64) {
if (atSignIndex >= 0 && url.pathname.length - atSignIndex === 65) {
return redirectWithoutHash(url, atSignIndex);
}
const newUrl = await resolvePluginOrSchemaUrl(url);
Expand Down Expand Up @@ -167,5 +167,6 @@ function create404Response() {
}

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

1 comment on commit 630a14c

@deno-deploy
Copy link

@deno-deploy deno-deploy bot commented on 630a14c Jun 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed to deploy:

Relative import path "preact-render-to-string" not prefixed with / or ./ or ../

Please sign in to comment.