Skip to content

Commit 27c437c

Browse files
authored
Merge pull request #7020 from topcoder-platform/pm-196
PM-196: xss dom security issue
2 parents dba16a6 + 8e86304 commit 27c437c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/shared/utils/url.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ import { BUCKETS } from 'utils/challenge-listing/buckets';
1414
*/
1515
export function getCurrentUrl() {
1616
if (isomorphy.isServerSide()) return null;
17-
return window.location.href;
17+
const url = window.location.href;
18+
19+
if (typeof url === 'string' && url.startsWith('http')) {
20+
return url;
21+
}
22+
23+
return null;
1824
}
1925

2026
/**

0 commit comments

Comments
 (0)