From 8e5e43de24c9bc93092b63efc67fbec029a9e7fe Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 27 Aug 2020 15:02:59 +0200 Subject: [PATCH] fix #4021 (#4179) --- mitmproxy/utils/typecheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mitmproxy/utils/typecheck.py b/mitmproxy/utils/typecheck.py index b2793e470..78537cc29 100644 --- a/mitmproxy/utils/typecheck.py +++ b/mitmproxy/utils/typecheck.py @@ -39,7 +39,7 @@ def check_option_type(name: str, value: typing.Any, typeinfo: Type) -> None: typename = str(typeinfo) - if typename.startswith("typing.Union"): + if typename.startswith("typing.Union") or typename.startswith("typing.Optional"): for T in union_types(typeinfo): try: check_option_type(name, value, T)