Show full blocked url request

This commit is contained in:
Kovid Goyal 2022-06-10 10:14:46 +05:30
parent 5265812c2f
commit 8b1ae42869
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -249,13 +249,13 @@ class RequestInterceptor(QWebEngineUrlRequestInterceptor):
return return
qurl = request_info.requestUrl() qurl = request_info.requestUrl()
if qurl.scheme() != 'file': if qurl.scheme() != 'file':
self.log.warn(f'Blocking URL request with scheme: {qurl.scheme()}') self.log.warn(f'Blocking URL request {qurl.toString()} as it is not for a local file')
request_info.block(True) request_info.block(True)
return return
path = qurl.toLocalFile() path = qurl.toLocalFile()
path = os.path.normcase(os.path.abspath(path)) path = os.path.normcase(os.path.abspath(path))
if not path.startswith(self.container_root) and not path.startswith(self.resources_root): if not path.startswith(self.container_root) and not path.startswith(self.resources_root):
self.log.warn(f'Blocking request with path: {path}') self.log.warn(f'Blocking URL request with path: {path}')
request_info.block(True) request_info.block(True)
return return