зеркало из https://github.com/openwpm/OpenWPM.git
Only accept boolean and string for save_content config option
This commit is contained in:
Родитель
4f7e3774d0
Коммит
3a2fc61f77
|
@ -15,7 +15,7 @@ import {
|
|||
WebRequestOnCompletedEventDetails,
|
||||
} from "../types/browser-web-request-event-details";
|
||||
|
||||
type SaveContentOption = boolean | string | ResourceType[];
|
||||
type SaveContentOption = boolean | string;
|
||||
|
||||
/**
|
||||
* Note: Different parts of the desired information arrives in different events as per below:
|
||||
|
@ -185,18 +185,13 @@ export class HttpInstrument {
|
|||
if (saveContentOption === false) {
|
||||
return false;
|
||||
}
|
||||
if (this.saveContentResourceTypes(saveContentOption).length > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return this.saveContentResourceTypes(saveContentOption).length > 0;
|
||||
}
|
||||
|
||||
private saveContentResourceTypes(
|
||||
saveContentOption: string | ResourceType[],
|
||||
saveContentOption: string,
|
||||
): ResourceType[] {
|
||||
return typeof saveContentOption === "string"
|
||||
? (saveContentOption.split(",") as ResourceType[])
|
||||
: saveContentOption;
|
||||
return saveContentOption.split(",") as ResourceType[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче