Skip to content

Commit

Permalink
fix(static): safe decode path (#1459)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Jul 19, 2023
1 parent 3687d31 commit 88831dc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/runtime/static.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { eventHandler, createError } from "h3";
import { joinURL, withoutTrailingSlash, withLeadingSlash, parseURL } from "ufo";
import {
decodePath,
joinURL,
parseURL,
withLeadingSlash,
withoutTrailingSlash,
} from "ufo";
import {
getAsset,
readAsset,
Expand All @@ -16,7 +22,7 @@ export default eventHandler((event) => {
return;
}

let id = decodeURIComponent(
let id = decodePath(
withLeadingSlash(
withoutTrailingSlash(parseURL(event.node.req.url).pathname)
)
Expand Down

0 comments on commit 88831dc

Please sign in to comment.