Skip to content
Myr

Parse cookies when users set custom Host header

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Ian Cordasco · committed by Ian Cordasco · parent d8180f5 · Browse files · 1 file+9 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+9 added−2 removed

  • other:+9 added−2 removed

1 file+9 added−2 removed

modified:requests/cookies.py+9 added-2 removed
6 unmodified lines
7"""89import time10import collections11from .compat import cookielib, urlparse, Morsel11from .compat import cookielib, urlparse, urlunparse, Morsel1213try:14 import threading15 # grr, pyflakes: this fixes "redefinition of unused 'threading'"
28 unmodified lines
44 def get_origin_req_host(self):45 return self.get_host()4647 def get_full_url(self):48 if not self._r.headers.get('Host'):48 return self._r.url49 return self._r.url50 host = self._r.headers['Host']51 parsed = urlparse(self._r.url)52 return urlunparse([53 parsed.scheme, host, parsed.path, parsed.params, parsed.query,54 parsed.fragment55 ])5657 def is_unverifiable(self):58 return True59
354 unmodified lines