From 592105b9ee6a9c6f3d9bd7358bc5ab18f8ded0c8 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 28 Sep 2021 01:46:40 +0200 Subject: Print detected content encoding info only if it's actually been detected --- jfr_playoff/remote.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'jfr_playoff/remote.py') diff --git a/jfr_playoff/remote.py b/jfr_playoff/remote.py index b918ea1..8f6f78f 100644 --- a/jfr_playoff/remote.py +++ b/jfr_playoff/remote.py @@ -18,10 +18,10 @@ class RemoteUrl: encoding_match = re.search( 'content=".*;( )?charset=(.*?)"', request.content, re.IGNORECASE) - PlayoffLogger.get('remote').debug( - 'Content encoding: %s', - encoding_match.group(2)) if encoding_match: + PlayoffLogger.get('remote').debug( + 'Content encoding: %s', + encoding_match.group(2)) request.encoding = encoding_match.group(2) cls.url_cache[url] = request.text PlayoffLogger.get('remote').info( -- cgit v1.2.3