Skip to content

Commit

Permalink
fix: replace cleanUrl with ctx.path (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
Day authored May 13, 2020
1 parent 8a1fbfe commit f558a88
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/node/server/serverPluginServeStatic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ export const serveStaticPlugin: ServerPlugin = ({

// history API fallback
app.use((ctx, next) => {
const cleanUrl = ctx.url.split('?')[0].split('#')[0]
if (ctx.method !== 'GET') {
debug(`not redirecting ${ctx.url} (not GET)`)
return next()
}

if (cleanUrl.includes('.')) {
if (ctx.path.includes('.')) {
debug(`not redirecting ${ctx.url} (relative url)`)
return next()
}
Expand Down

0 comments on commit f558a88

Please sign in to comment.