Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions src/third-party/PhishingController.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -54,8 +54,6 @@ export interface PhishingState extends BaseState {
export class PhishingController extends BaseController<PhishingConfig, PhishingState> {
private configUrl = 'https://cdn.jsdelivr.net/gh/MetaMask/eth-phishing-detect@master/src/config.json';

private configEtag = '';

private detector: any;

private handle?: NodeJS.Timer;
Expand DownExpand Up@@ -141,15 +139,10 @@ export class PhishingController extends BaseController<PhishingConfig, PhishingS
}

private async queryConfig(input: RequestInfo): Promise<EthPhishingResponse | null> {
const response = await fetch(input, {
headers: {
'If-None-Match': this.configEtag,
},
});
const response = await fetch(input);

switch (response.status) {
case 200: {
this.configEtag = response.headers.get('ETag') || /* istanbul ignore next */ '';
return await response.json();
}
case 304:
Expand Down