Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit da1ffbc

Browse files
committed
Issue #15409: Replace use of deprecated urllib.request.Request methods in http.cookijar
Patch by Flávio Ribeiro.
1 parent 5e36edb commit da1ffbc

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Lib/http/cookiejar.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ def request_path(request):
625625
return path
626626

627627
def request_port(request):
628-
host = request.get_host()
628+
host = request.host
629629
i = host.find(':')
630630
if i >= 0:
631631
port = host[i+1:]
@@ -949,7 +949,7 @@ def set_ok_version(self, cookie, request):
949949
return True
950950

951951
def set_ok_verifiability(self, cookie, request):
952-
if request.is_unverifiable() and is_third_party(request):
952+
if request.unverifiable and is_third_party(request):
953953
if cookie.version > 0 and self.strict_rfc2965_unverifiable:
954954
_debug(" third-party RFC 2965 cookie during "
955955
"unverifiable transaction")
@@ -1088,7 +1088,7 @@ def return_ok_version(self, cookie, request):
10881088
return True
10891089

10901090
def return_ok_verifiability(self, cookie, request):
1091-
if request.is_unverifiable() and is_third_party(request):
1091+
if request.unverifiable and is_third_party(request):
10921092
if cookie.version > 0 and self.strict_rfc2965_unverifiable:
10931093
_debug(" third-party RFC 2965 cookie during unverifiable "
10941094
"transaction")
@@ -1100,7 +1100,7 @@ def return_ok_verifiability(self, cookie, request):
11001100
return True
11011101

11021102
def return_ok_secure(self, cookie, request):
1103-
if cookie.secure and request.get_type() != "https":
1103+
if cookie.secure and request.type != "https":
11041104
_debug(" secure cookie with non-secure request")
11051105
return False
11061106
return True

0 commit comments

Comments
 (0)