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:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user