origin->originalURL, because origin has a special meaning
This commit is contained in:
parent
395e2206e1
commit
dc28bd5fa2
|
@ -16,7 +16,7 @@ export default class ExtendedRequest {
|
||||||
public url: string;
|
public url: string;
|
||||||
public shorthost: string;
|
public shorthost: string;
|
||||||
public requestHeaders: Request["requestHeaders"];
|
public requestHeaders: Request["requestHeaders"];
|
||||||
public origin: string;
|
public originalURL: string;
|
||||||
public initialized = false;
|
public initialized = false;
|
||||||
public stolenData: StolenDataEntry[];
|
public stolenData: StolenDataEntry[];
|
||||||
|
|
||||||
|
@ -34,19 +34,19 @@ export default class ExtendedRequest {
|
||||||
} else {
|
} else {
|
||||||
url = (this.data as any).frameAncestors[0].url;
|
url = (this.data as any).frameAncestors[0].url;
|
||||||
}
|
}
|
||||||
this.origin = new URL(url).origin;
|
this.originalURL = new URL(url).origin;
|
||||||
}
|
}
|
||||||
|
|
||||||
getOrigin(): string {
|
getOriginalURL(): string {
|
||||||
if (!this.initialized) {
|
if (!this.initialized) {
|
||||||
throw new Error("initialize first!!");
|
throw new Error("initialize first!!");
|
||||||
}
|
}
|
||||||
return this.origin;
|
return this.originalURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
isThirdParty() {
|
isThirdParty() {
|
||||||
const request_url = new URL(this.data.url);
|
const request_url = new URL(this.data.url);
|
||||||
const origin_url = new URL(this.getOrigin());
|
const origin_url = new URL(this.getOriginalURL());
|
||||||
if (request_url.host.includes(origin_url.host)) {
|
if (request_url.host.includes(origin_url.host)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ export default class ExtendedRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
exposesOrigin() {
|
exposesOrigin() {
|
||||||
const url = new URL(this.getOrigin());
|
const url = new URL(this.getOriginalURL());
|
||||||
const host = url.host;
|
const host = url.host;
|
||||||
const path = url.pathname;
|
const path = url.pathname;
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -41,7 +41,9 @@ function Report() {
|
||||||
style={{
|
style={{
|
||||||
width: "400px",
|
width: "400px",
|
||||||
overflowWrap: "anywhere",
|
overflowWrap: "anywhere",
|
||||||
backgroundColor: entry.isRelatedToID() ? "yellow" : "white",
|
backgroundColor: entry.isRelatedToID()
|
||||||
|
? "#ffff0054"
|
||||||
|
: "white",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{entry.value}
|
{entry.value}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user