fix: logtrack worker url formation

This commit is contained in:
cwilvx
2024-11-24 18:08:54 +03:00
parent 54ab071803
commit 9b938194a6

View File

@@ -2,7 +2,8 @@ onmessage = (e) => {
const { trackhash, duration, source, timestamp } = e.data;
const is_dev = location.port === "5173";
const base_url = is_dev ? "http://localhost:1980" : location.origin;
const protocol = location.protocol.replace(':', '');
const base_url = is_dev ? `${protocol}://${location.hostname}:1980` : location.origin;
const url = base_url + "/logger/track/log";
fetch(url, {