Skip to content

Commit

Permalink
Try this.
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed Jun 24, 2023
1 parent 630a14c commit 5787d8b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion handleRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ export async function handleRequest(request: Request) {
if (atSignIndex >= 0 && url.pathname.length - atSignIndex === 65) {
return redirectWithoutHash(url, atSignIndex);
}
if (url.pathname.includes("testing-this-out")) {
return new Response(Deno.env.get("DPRINT_PLUGINS_GH_TOKEN")?.substring(0, 5) ?? "fail", {
status: 200,
});
}
const newUrl = await resolvePluginOrSchemaUrl(url);
if (newUrl != null) {
const contentType = newUrl.endsWith(".json")
Expand Down Expand Up @@ -167,6 +172,6 @@ function create404Response() {
}

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

1 comment on commit 5787d8b

@deno-deploy
Copy link

@deno-deploy deno-deploy bot commented on 5787d8b 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.