From 91111acfcf516cb062be57ca5de9f32fc4265a33 Mon Sep 17 00:00:00 2001 From: Erisa A Date: Wed, 26 Apr 2023 01:28:27 +0000 Subject: [PATCH] Fix shortUrl in result --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index ef313ae..fd28588 100644 --- a/src/index.ts +++ b/src/index.ts @@ -50,7 +50,7 @@ const app = new Hono() app.use('*', async (c, next) => { const path = new URL(c.req.url).pathname let key = path !== '/' ? path.replace(/\/$/, '') : path - let shortUrl = new URL(key, c.req.url).origin + let shortUrl = new URL(key, c.req.url).toString() c.set('path', path) c.set('key', key)