Commit Graph

288 Commits

Author SHA1 Message Date
kennethreitz 63e18ff2cc working! 2019-04-19 10:39:50 -04:00
kennethreitz 0e4eb5683b refactor 2019-04-18 15:39:34 -04:00
kennethreitz e14c28a109 merge 2019-04-18 15:15:11 -04:00
Seth M. Larson ad9400ecfe Normalize percent-encoded bytes before comparison 2018-12-23 15:50:16 -06:00
Nate Prewitt ea9436a5d6 proper handling for default ports in auth stripping 2018-10-28 23:29:04 -07:00
Nate Prewitt 7fd9267b3b remove final remnants from 2.6 2018-10-17 00:18:51 -07:00
Hugo Osvaldo Barrera 89ab030cdb Use comprehensions whenever possible 2018-10-16 20:34:22 -07:00
Nate Prewitt bbdbcc8f05 wrap url parsing exceptions from urllib3's PoolManager 2018-09-30 18:36:05 -06:00
Bruce Merry 857e9b7ac2 Rework authorization stripping logic as discussed
The exception for http->https upgrade now requires the standard HTTP(S)
ports to be used, either implicitly (no port specified) or explicitly.
2018-09-14 10:44:43 +02:00
Bruce Merry 3331e2aecd Strip Authorization header whenever root URL changes
Previously the header was stripped only if the hostname changed, but in
an https -> http redirect that can leak the credentials on the wire
(#4716). Based on with RFC 7235 section 2.2, the header is now stripped
if the "canonical root URL" (scheme+authority) has changed, by checking
scheme, hostname and port.
2018-09-14 10:44:43 +02:00
Antti Kaihola 691e9520ed Add test for multivalued form-encoded element as a list (#4700) 2018-07-20 10:30:31 +03:00
Steven M. Vascellaro 4d51e6d201 Remove unused httpbin parameters
httpbin is used to mock HTTP endpoints. In these methods, the parameter
goes unused.
2018-07-17 19:39:18 -07:00
Steven M. Vascellaro 28da72b616 Remove unused session variables
Removed local session variables that go unused during testing.
2018-06-26 12:34:15 -04:00
Raymond Hettinger 7e297ed95b Separate collections from collections.abc 2018-06-11 22:14:59 -07:00
Laurent Bachelier 10915e3b0d Add a public method to get the cookie policy 2018-06-11 22:13:07 -07:00
Laurent Bachelier ace0c200f4 Add cookie policy related tests 2018-06-11 22:13:07 -07:00
Rajiv Mayani 8546a15587 The library raises NoneType error when file-pointer (fp) resolves to None.
>>> from requests import post
>>> r = post("https://example.com", files={"file-name": None})

However, when a param value or json field is None they are not included in the request body.

>>> from requests import get
>>> r = get("https://example.com", params={"file-name": None})
>>> r.request.url

This commit makes the beahviour consistent for files.
2018-05-17 13:56:17 -07:00
kennethreitz c6464c1770 /s/requests/requests3 2018-03-16 19:06:08 -04:00
kennethreitz 3951232f8c fix tests
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
2018-03-15 17:09:39 -04:00
kennethreitz 86ab1ce916 session fixture
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
2018-03-15 17:07:59 -04:00
kennethreitz cac7a2843d white
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
2018-03-15 16:33:33 -04:00
kennethreitz b6bc1d06aa passing tests™ 2018-03-15 16:32:16 -04:00
kennethreitz e16fc666af white / improvements
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
2018-03-15 14:20:53 -04:00
kennethreitz 5574076b05 __slots__
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
2018-03-15 11:01:25 -04:00
kennethreitz 64d85b7ebf use rfc8936 2018-03-15 10:39:26 -04:00
kennethreitz b2e99359fc merge 2018-03-15 08:59:47 -04:00
kennethreitz 8a1baaf47b white 2018-03-15 06:56:20 -04:00
kennethreitz 9cea8ce09d black
https://github.com/ambv/black
2018-03-14 17:28:51 -04:00
kennethreitz 6be73f90b1 /s/compat/basics 2018-03-12 11:53:12 -04:00
David Poole 85ec7d759e Merge branch 'master' into master 2018-03-05 09:07:12 -07:00
Jon Dufresne 4c6d9e1954 Remove requests.packages for v3.0.0
As v3.0.0 already includes other backwards incompatible changes, it is a
good time to remove the old entry point for vendored packages. Cleans up
compatibility shims.
2018-02-04 19:07:26 -08:00
Nate Prewitt f60324a3de append previous url fragment on redirect 2018-01-21 09:55:45 -08:00
David Poole 1e46cbb4f0 add test for HTTP Digest auth algorithms SHA-256 and SHA-512 2017-11-29 07:10:57 -07:00
Nehal J Wani 9a8a826f22 Check if host is invalid for proxy
According to RFC3986, the authority section can be empty for a given URL,
however, for a proxy URL, it shouldn't be. This patch adds a check to verify
that the parsed URL will have a valid host before creating the proxy manager.

Fixes #4353
2017-11-15 08:58:54 -05:00
Alvaro Gutierrez Perez d165b18b6e Split test in two better-defined tests 2017-10-19 17:04:48 +02:00
Alvaro Gutierrez Perez e11989e8ec Add test for Session.get_adapter() prefix matching 2017-10-19 16:50:13 +02:00
Alvaro Gutierrez Perez af88af64e6 Add test for Session.get_adapter() case-insensitivity 2017-10-19 16:50:13 +02:00
hugovk 006aa3de4f Drop Python 2.6: OrderedDict is in collections from 2.7 2017-10-17 16:56:56 +03:00
Nate Prewitt 37f1d23c39 Merge remote-tracking branch 'upstream/master' into proposed/3.0.0 2017-10-15 13:59:50 -07:00
kennethreitz 28ae74dbad update tests
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
2017-09-17 11:46:33 -04:00
Allan Crooks a36247e148 Rename HTTPHeaderDict methods to getlist and setlist to be more consistent with other similar implementations. 2017-09-12 23:14:00 +01:00
Allan Crooks 5aef6e7583 Use HTTPHeaderDict for response headers. 2017-09-12 22:17:23 +01:00
Allan Crooks 5980d5df3e Add tests showing current behaviour of how multiple response headers with the same name are compiled into a single value. 2017-09-12 22:16:31 +01:00
mgasvoda cbc7c2d1c9 Modifying tests to include header name info 2017-08-11 17:18:58 -04:00
Cory Benfield 8b3f20ca91 Add failing test for #4209 2017-07-29 12:09:04 +01:00
Hugo Osvaldo Barrera 9766870807 Use comprehensions whenever possible 2017-07-14 11:42:32 -03:00
Jeremy Cline 66f5aebd35 Remove the dictionary comprehension from the tests
Signed-off-by: Jeremy Cline <jeremy@jcline.org>
2017-06-27 09:29:01 -04:00
Jeremy Cline bacd043256 Tests to demonstrate issue #3633
Signed-off-by: Jeremy Cline <jeremy@jcline.org>
2017-06-24 18:58:20 -04:00
Felix Yan a0f0258eee Fix a typo: paramters -> parameters 2017-06-12 01:27:11 +08:00
Justin Mayhew c6a6347156 Remove exec permission from files that shouldn't have it 2017-06-10 20:38:45 -03:00