diff --git a/memory.ts b/memory.ts index f9bec5a..29b8e73 100644 --- a/memory.ts +++ b/memory.ts @@ -7,19 +7,19 @@ export default class Memory extends EventEmitter { origin_to_history = {} as Record>; async register(request: ExtendedRequest) { await request.init(); - console.log("registering request for", request.origin); + console.log("registering request for", request.originalURL); if (!request.isThirdParty()) { return; } - if (!this.origin_to_history[request.origin]) { - this.origin_to_history[request.origin] = {}; + if (!this.origin_to_history[request.originalURL]) { + this.origin_to_history[request.originalURL] = {}; } const shorthost = getshorthost(new URL(request.url).host); - if (!this.origin_to_history[request.origin][shorthost]) { + if (!this.origin_to_history[request.originalURL][shorthost]) { const cluster = new RequestCluster(shorthost); - this.origin_to_history[request.origin][shorthost] = cluster; + this.origin_to_history[request.originalURL][shorthost] = cluster; } - this.origin_to_history[request.origin][shorthost].add(request); + this.origin_to_history[request.originalURL][shorthost].add(request); this.emit("change"); } diff --git a/stolen-data-entry.ts b/stolen-data-entry.ts index a2ffd02..804812d 100644 --- a/stolen-data-entry.ts +++ b/stolen-data-entry.ts @@ -49,7 +49,7 @@ export class StolenDataEntry { getPriority() { let priority = 0; priority += Math.min(this.value.length, 50); - const url = new URL(this.request.getOrigin()); + const url = new URL(this.request.originalURL); if (this.value.includes(url.host)) { priority += 100; } @@ -127,7 +127,7 @@ export class StolenDataEntry { } private classify(): keyof typeof Classifications { - if (this.value.includes(this.request.origin)) { + if (this.value.includes(this.request.originalURL)) { return "history"; } else { return "id";