Use to_native when validating proxy result (#32596)

* Use bytes directly instead of converting to text
This commit is contained in:
David Hain 2017-11-06 12:20:07 -05:00 committed by Toshio Kuratomi
commit 708829fab9

View file

@ -677,7 +677,7 @@ class SSLValidationHandler(urllib_request.BaseHandler):
valid_codes = [200] if valid_codes is None else valid_codes
try:
(http_version, resp_code, msg) = re.match(r'(HTTP/\d\.\d) (\d\d\d) (.*)', response).groups()
(http_version, resp_code, msg) = re.match(br'(HTTP/\d\.\d) (\d\d\d) (.*)', response).groups()
if int(resp_code) not in valid_codes:
raise Exception
except: