diff --git a/httpbin/core.py b/httpbin/core.py index 305c9882..96fb8019 100644 --- a/httpbin/core.py +++ b/httpbin/core.py @@ -178,7 +178,7 @@ def jsonify(*args, **kwargs): ignore_classes=["werkzeug.exceptions.NotFound"], ) bugsnag.flask.handle_exceptions(app) - except: + except Exception: app.logger.warning("Unable to initialize Bugsnag exception handling.") # ----------- @@ -1307,7 +1307,7 @@ def decode_base64(value): encoded = value.encode("utf-8") # base64 expects binary string as input try: return base64.urlsafe_b64decode(encoded).decode("utf-8") - except: + except Exception: return "Incorrect Base64 data try: SFRUUEJJTiBpcyBhd2Vzb21l" diff --git a/httpbin/helpers.py b/httpbin/helpers.py index b29e1835..e322f863 100644 --- a/httpbin/helpers.py +++ b/httpbin/helpers.py @@ -402,12 +402,12 @@ def __parse_request_range(range_header_text): try: right = int(components[1]) - except: + except Exception: pass try: left = int(components[0]) - except: + except Exception: pass return left, right