Fix challenge link generation

This commit is contained in:
Lynn
2022-01-18 22:15:53 +01:00
parent e9ab562aac
commit 6583be1968

View File

@@ -27,10 +27,7 @@ function randomTarget(wordLength: number): string {
} }
function getChallengeUrl(target: string): string { function getChallengeUrl(target: string): string {
return window.location.href.replace( return window.location.origin + window.location.pathname + "?challenge=" + encode(target);
/(\?.*)?$/,
"?challenge=" + encode(target)
);
} }
let challengeString = ""; let challengeString = "";