Commit Graph

4413 Commits

Author SHA1 Message Date
Cory Benfield 7a404cf4ec Document header ordering. (#3295) 2016-06-08 11:44:33 -05:00
kennethreitz 8813787a12 wildly inaccurate button results in deletion
(not the button's fault!)
2016-06-04 22:08:47 -04:00
Cory Benfield bca205e9bf Merge pull request #3251 from sigmavirus24/bug/3250
Update documentation of Session.max_redirects
2016-06-01 11:08:39 -07:00
Ian Cordasco de4c75bbad Update documentation of Session.max_redirects
Fixes #3250
2016-06-01 11:00:42 -05:00
Seppo Yli-Olli 9e9d2c6521 Make BaseAdapter describe the mandatory adapter interface (#3216)
* BaseAdapter definition of send is missing mandatory params

* Copy over relevant parts of the interface documentation

* Indentation fix

* Change base class documentation for close
2016-05-24 13:23:16 -05:00
Cory Benfield 49b69c4751 Merge pull request #3178 from haikuginger/master
Encoding JSON requests to bytes for urllib3 to handle
2016-05-22 17:02:09 +01:00
Brett Higgins b6d6894f53 Allow graceful interruption of testserver.Server
So that failing tests don't cause the server thread to hang
indefinitely, waiting for connections that will never come.

Rationale for suppressing error/traceback from interrupted
_accept_connection in testserver.Server:
https://gist.github.com/brettdh/b6e741227b2297f19d2118077f14dfa5

* Move server socket close to just before join

This way it handles the no-connections, no-exceptions case
as well as the exception case. If the server thread doesn't
exit by itself within 5 seconds of the context manager exit,
the accept will be interrupted.

* Address feedback

- pytest.raises rather than except:pass
- Move socket create/bind back to run()
- Timeout on accepting connections
2016-05-17 10:45:12 -05:00
Ian Cordasco cd4e6b9aef Merge pull request #3185 from brettdh/3183-support-all-proxy-env-var
Support ALL_PROXY environment variable
2016-05-17 10:42:31 -05:00
Brett Higgins 35744c3e5d Use iter instead of noop list comprehension 2016-05-16 21:53:20 -04:00
Ian Cordasco 12e3631827 Merge pull request #3195 from kumarvaradarajulu/no_proxy_fix
Fix to check for Plain ip notations in no_proxy settings if not CIDR
2016-05-16 07:47:33 -05:00
Kumar Varadarajulu b94decc47c Combined tests to one tests for should_bypass_proxies method 2016-05-16 10:49:37 +00:00
Kumar Varadarajulu f59a95713e Added tests for should_bypass_proxies function 2016-05-16 10:40:22 +00:00
Kumar Varadarajulu 17b6c5742c consider plain ip notation of an ip in no_proxy if not in cidr notation 2016-05-16 06:11:25 +00:00
Brett Higgins 4bf8866172 Add 'all' proxy selection to select_proxy
It seems it's necessary both in pulling all_proxy from the environment
(rebuild_proxies) and deciding which proxy to use (select_proxy).

Also added new functional test.
2016-05-13 15:30:38 -04:00
Ian Cordasco 4865f0f9bf Merge pull request #3188 from Lukasa/fixup-indentation
Replace tab with appropriate spaces.
2016-05-12 08:11:19 -05:00
Cory Benfield 0838685dab Replace tab with appropriate spaces. 2016-05-12 10:57:52 +01:00
Brett Higgins 1121f8b915 Support ALL_PROXY environment variable
Closes #3183.
2016-05-11 10:37:53 -04:00
Cory Benfield 87704105af Merge pull request #3179 from messense/messense-patch-1
Fix TypeError when get json-encoded content of a response
2016-05-06 13:59:01 +01:00
messense cb4c2c0b65 Fix TypeError when get json-encoded content of a response
``self.content`` could be ``None``, so ``len(self.content)`` may raise ``TypeError: object of type 'NoneType' has no len()``
2016-05-06 09:53:14 +08:00
Ian Cordasco 3669b4216a Merge pull request #3173 from Lukasa/socks-proxy-docs
Add section on SOCKS proxies.
2016-05-05 12:18:27 -05:00
Jesse Shapiro 04bb965c87 Fixing test; it was accomplishing the right thing, but doing it in the wrong way. 2016-05-05 12:23:59 -04:00
Jesse Shapiro 52c0daff5f Cleaning up comment on JSON encoding to be more strictly relevant. 2016-05-05 12:12:49 -04:00
Jesse Shapiro 9ff2e43cd6 Removing charset from JSON content type; tightening requirements on .encode() 2016-05-05 06:27:12 -04:00
Jesse Shapiro 386382b18c Encoding JSON requests to bytes for urllib3 to handle; ensuring same with testing. 2016-05-04 20:09:07 -04:00
Cory Benfield 989e8f15dd Merge pull request #3171 from luv/master
docs: Add a note about SSL c_rehash
2016-05-03 08:44:42 +01:00
Cory Benfield 339e950dc7 Add section on SOCKS proxies. 2016-05-03 08:07:30 +01:00
Lukas Vacek 52facb2257 docs: Add a note about SSL c_rehash 2016-05-02 23:03:35 +02:00
kennethreitz 296928f36f fixed date formatting 2016-04-29 18:17:21 -04:00
kennethreitz efb4af0127 v2.10.0 v2.10.0 2016-04-29 18:11:49 -04:00
kennethreitz f69d8c16ed updated urllib3 (v1.15.1) 2016-04-29 18:11:17 -04:00
kennethreitz a5da4f399f v2.10.0 2016-04-29 18:03:28 -04:00
kennethreitz 39d6935488 Merge pull request #2953 from Lukasa/socks_proxy_support
SOCKS Proxy Support
2016-04-29 18:03:04 -04:00
kennethreitz c9ef5653cc v2.9.2 v2.9.2 2016-04-29 17:56:42 -04:00
kennethreitz 2824867412 v2.9.2 2016-04-29 17:52:19 -04:00
kennethreitz f803dc6c99 updated authors 2016-04-29 17:52:11 -04:00
kennethreitz ce5e312593 Merge pull request #3096 from piotrjurkiewicz/master
Change _store of CaseInsensitiveDict to OrderedDict
2016-04-29 17:47:35 -04:00
Ian Cordasco ecebf337ed Merge pull request #3139 from markshannon/fix/3138
Initialize hash_utf8 to None, preventing NameError. Fixes #3138.
2016-04-29 11:05:19 -05:00
Mark Shannon abe02ed89f Initialize hash_utf8 to None, preventing NameError. Fixes #3138. 2016-04-29 16:49:24 +01:00
Cory Benfield 252bfa7885 Merge pull request #3136 from Natim/readthedocs.io
Update readthedocs links.
2016-04-28 11:43:14 +01:00
Rémy HUBSCHER 70a344d8eb Update readthedocs links. 2016-04-28 12:39:10 +02:00
Cory Benfield 343027893b Merge pull request #3132 from chipaca/no-hostname-no-cry
utils: let select_proxy not raise an exception when url has no hostname
2016-04-26 11:35:23 +01:00
John R. Lenton 4e7beef860 utils: let select_proxy not raise an exception when url has no hostname 2016-04-26 11:22:44 +01:00
Ian Cordasco bbeb0001cd Merge pull request #3108 from kevinburke/flip-conditional
Flip conditional in session.send()
2016-04-21 10:30:22 -05:00
Kevin Burke ae1ac2d4e0 Flip conditional in session.send()
Previously we checked that the `request` being sent was an instance of a
PreparedRequest. If a user somehow created a PreparedRequest using a different
Requests library instance, this check makes the request un-sendable.

(This happened recently - unbeknownst to me, my server was running an outdated
version of pip, vulnerable to this issue - pypa/pip#1489, which creates
multiple subdirectories (src/requests, src/requests/requests) when you rerun
pip install --target. So the PreparedRequest was being created in one version
of the library and compared against the other version of the library, and
throwing this exception, even though they were both PreparedRequest instances!)

It would probably be preferable to check the object's behavior (instead of
its type), but a PreparedRequest has a lot of behavior, and it wouldn't be
really feasible or allow us to provide a helpful error message to check all
of it here. Instead flip the conditional to guard against the user sending an
unprepared Request, which should still give us most of the benefits of the
better error message.

Fixes #3102
2016-04-21 08:12:05 -07:00
kennethreitz aa1c3adf9a Merge pull request #3100 from hitstergtd/hitstergtd-docfixes-1
Remove stale sentence in philosophy.rst
2016-04-17 13:26:24 -04:00
Piotr Jurkiewicz b1a7dcd799 Fix test_headers_preserve_order 2016-04-16 22:21:10 +02:00
Hitster GTD d801d7797e Remove stale sentence in philosophy.rst
Sentence contained reference to version 1.0.0.
2016-04-16 10:57:24 +01:00
Ian Cordasco 60aee145b9 Merge pull request #3091 from bodgit/proxy
Clear any pooled proxy connections
2016-04-15 07:50:06 -05:00
Matt Dainty 2029a8a931 Clear any pooled proxy connections
As well as clearing any pooled direct connections, iterate over any
ProxyManager objects and clear any pooled proxy connections there as well.
2016-04-15 09:33:37 +01:00
Piotr Jurkiewicz c8a0fc6aa2 Use OrderedDict from .compat module 2016-04-15 04:43:53 +02:00