Skip to content

Commit f31e963

Browse files
fix(templates): potential DOM XSS
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 98646e6 commit f31e963

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/server/templates/index.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,9 @@
333333
});
334334

335335
function toggleJSON() {
336-
window.location.href = window.location.href + '.json';
336+
const url = new URL(window.location.href);
337+
url.pathname = url.pathname + '.json';
338+
window.location.href = url.toString();
337339
}
338340
</script>
339341
</body>

0 commit comments

Comments
 (0)