mirror of
https://github.com/morpheus65535/bazarr.git
synced 2026-07-30 17:48:04 -04:00
no log: Improved request logging in OpenSubtitles provider by adding checks for empty requests and responses before processing to prevent exceptions and throttling of the provider for no reason.
This commit is contained in:
@@ -606,6 +606,10 @@ class OpenSubtitlesComProvider(ProviderRetryMixin, Provider):
|
||||
|
||||
|
||||
def log_request_response(response, non_standard=True):
|
||||
if not response or not response.request:
|
||||
logger.debug("No request or response to log.")
|
||||
return
|
||||
|
||||
redacted_request_headers = response.request.headers
|
||||
if 'Authorization' in redacted_request_headers and isinstance(redacted_request_headers['Authorization'], str):
|
||||
redacted_request_headers['Authorization'] = redacted_request_headers['Authorization'][:-8]+8*'x'
|
||||
|
||||
Reference in New Issue
Block a user