Hi,
there is an issue with a fetch request. Sometimes it works, sometimes it doesn’t. I can’t identify a clear pattern for when it fails. On mobile devices it fails more often than on laptops.
I suspect this is related to InfinityFree’s JavaScript-based cookie test. When the request fails, the fetch call receives the following response instead of the expected output.
Error Message
<html>
<body>
<script type="text/javascript" src="/aes.js"></script>
<script>
function toNumbers(d) {
var e = [];
d.replace(/(..)/g, function(d) {
e.push(parseInt(d, 16))
});
return e
}
function toHex() {
for (var d = [], d = 1 == arguments.length && arguments[0].constructor == Array ? arguments[0] : arguments, e = "", f = 0; f < d.length; f++)
e += (16 > d[f] ? "0" : "") + d[f].toString(16);
return e.toLowerCase()
}
var a = toNumbers("f655ba9d09a112d4968c63579db590b4")
, b = toNumbers("98344c2eee86c3994890592585b49f80")
, c = toNumbers("98c3862474363354a836bb90229f6bee");
document.cookie = "__test=" + toHex(slowAES.decrypt(c, 2, a, b)) + "; max-age=21600; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/";
location.href = "https://share.leanderbrunar.net/tracking/track.php?download=1&album=testalbum%20%E2%80%93%20test&i=1";
</script>
<noscript>
This site requires JavaScript to work, please enable JavaScript in your browser or use a browser with JavaScript support.
</noscript>
</body>
</html>
Other Information
Here is the code of the fetch request I am triggering:
// download-tracking
document.querySelectorAll(".download-button").forEach(button => {
button.addEventListener("click", function () {
fetch(`tracking/track.php?download=1&album=${encodeURIComponent(h1 + " – " + h2)}`)
.catch(error => console.error('Tracking-Fehler:', error));
});
});
The problem occurs only with this specific fetch request; every other fetch on the site works without issues.
Could you please help me understand what is causing this?
Thanks!