1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2025-06-05 21:49:31 +02:00

Block all non GET requests to CDN (#1226)

This commit is contained in:
nobody
2022-11-29 07:03:15 +01:00
parent c9d2eb85ce
commit 0465b630d1
4 changed files with 24 additions and 0 deletions

View File

@@ -54,6 +54,15 @@ interceptor.handleRequest = function (requestDetails, tabIdentifier, tab) {
tabIdentifier, targetDetails
};
// Block POST, HEAD, PUT, DELETE, TRACE, OPTIONS
if (BlockedRequestMethods[requestDetails.method]) {
console.warn(`${LogString.PREFIX} ${LogString.NON_GET_REQUEST_BLOCKED}`);
log.append(tab.url, requestDetails.url, LogString.NON_GET_REQUEST_BLOCKED, true);
return {
'cancel': true
};
}
validCandidate = requestAnalyzer.isValidCandidate(requestDetails, tab);
if (!validCandidate) {
return {