Skip to content

Commit

Permalink
refactor: fixes a security issue
Browse files Browse the repository at this point in the history
  • Loading branch information
asadali214 committed Jul 18, 2024
1 parent e624406 commit b6b082d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/http/requestBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -674,9 +674,9 @@ function mergePath(left: string, right?: string): string {
return left;
}
// remove all occurances of `/` (if any) from the end of left path
left = left.replace(new RegExp(`/+$`), '');
left = left.replace('/', ' ').trimEnd().replace(' ', '/');
// remove all occurances of `/` (if any) from the start of right sub-path
right = right.replace(new RegExp(`^/+`), '');
right = right.replace('/', ' ').trimStart().replace(' ', '/');

return `${left}/${right}`;
}
Expand Down

0 comments on commit b6b082d

Please sign in to comment.