Skip to content

Commit

Permalink
fix: decode incoming URL
Browse files Browse the repository at this point in the history
fixes cases where user paths contains chars that are encoded
when used in URLs.

fix #1308
  • Loading branch information
yyx990803 committed Jan 3, 2021
1 parent 38b9613 commit f52db58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/server/middlewares/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export function transformMiddleware(
} = server

return async (req, res, next) => {
let url = removeTimestampQuery(req.url!)
if (
req.method !== 'GET' ||
req.headers.accept?.includes('text/html') ||
Expand All @@ -40,6 +39,7 @@ export function transformMiddleware(
return next()
}

let url = decodeURI(removeTimestampQuery(req.url!))
const withoutQuery = cleanUrl(url)

try {
Expand Down

0 comments on commit f52db58

Please sign in to comment.