Skip to content

Commit

Permalink
Normalize referrer
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoSWD committed Apr 21, 2024
1 parent c83fb41 commit 131e8bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion public/js/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,9 @@ const refresh = (async () => {
$('input[type="checkbox"]').on('change', () => refresh());

if (document.location.hostname === 'ifsc.stream') {
const normalize = (referrer) => encodeURIComponent(referrer.replace('https://', '').replace(/\/$/, ''));
const img = new Image();
img.src = 'https://calendar.ifsc.stream/pixel.gif?' + (document.referrer ? `r=${encodeURIComponent(document.referrer)}` : '');
img.src = 'https://calendar.ifsc.stream/pixel.gif' + (document.referrer ? `?r=${normalize(document.referrer)}` : '');
img.width = 1;
img.height = 1;

Expand Down

0 comments on commit 131e8bf

Please sign in to comment.