Skip to content

Commit

Permalink
fix: regular expression denial of service (ReDoS), axios/axios#6132
Browse files Browse the repository at this point in the history
  • Loading branch information
ModyQyW committed Dec 27, 2023
1 parent 4ed99cc commit 4db858b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/combineUrls.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const combineUrls = (baseUrl: string, relativeUrl: string) => {
return relativeUrl
? baseUrl.replace(/\/+$/, '') + '/' + relativeUrl.replace(/^\/+/, '')
? baseUrl.replace(/\/?\/$/, '') + '/' + relativeUrl.replace(/^\/+/, '')
: baseUrl;
};

0 comments on commit 4db858b

Please sign in to comment.