Skip to content

Commit

Permalink
fix(getRequestPath): avoid double normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jul 31, 2023
1 parent 6c87d87 commit 0181d33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export function getRequestProtocol(
const DOUBLE_SLASH_RE = /[/\\]{2,}/g;

export function getRequestPath(event: H3Event): string {
const path = event._originalPath.replace(DOUBLE_SLASH_RE, "/");
const path = event._originalPath;
if (path.includes("?")) {
const [basePath, query] = path.split("?");
return basePath.replace(DOUBLE_SLASH_RE, "/") + "?" + query;
Expand Down

0 comments on commit 0181d33

Please sign in to comment.