Skip to content

Commit

Permalink
fix(ipx): ensure leading slash is added to ipx url
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jul 8, 2022
1 parent 611bb53 commit 93ce78a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/runtime/ipx.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { fileURLToPath } from 'node:url'
import { createIPX, createIPXMiddleware } from 'ipx'
import { withLeadingSlash } from 'ufo'
import { eventHandler, lazyEventHandler } from 'h3'
import { useRuntimeConfig } from '#imports'

Expand All @@ -14,7 +15,7 @@ export default lazyEventHandler(() => {
const middleware = createIPXMiddleware(ipx)

return eventHandler(async (event) => {
event.req.url = event.context.params._
event.req.url = withLeadingSlash(event.context.params._)
await middleware(event.req, event.res)
})
})

0 comments on commit 93ce78a

Please sign in to comment.