Fix shortUrl in result

This commit is contained in:
Erisa A 2023-04-26 01:28:27 +00:00
parent 9e34fb15e6
commit 91111acfcf
No known key found for this signature in database

View file

@ -50,7 +50,7 @@ const app = new Hono<Env>()
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)