Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f549efd43d | ||
|
|
5eb3a17b55 | ||
|
|
b30b09e84c | ||
|
|
5152c98223 | ||
|
|
27c6dc3735 | ||
|
|
8b1b706903 | ||
|
|
64eee1eba7 | ||
|
|
1e64fbcb55 | ||
|
|
910b2312d6 | ||
|
|
9bb332fee1 | ||
|
|
31c73a61f9 |
11
HISTORY.rst
11
HISTORY.rst
@@ -3,6 +3,17 @@
|
||||
History
|
||||
-------
|
||||
|
||||
1.0.2 (2012-12-17)
|
||||
++++++++++++++++++
|
||||
|
||||
- Proxy fix for HTTPAdapter.
|
||||
|
||||
1.0.1 (2012-12-17)
|
||||
++++++++++++++++++
|
||||
|
||||
- Cert verification exception bug.
|
||||
- Proxy fix for HTTPAdapter.
|
||||
|
||||
1.0.0 (2012-12-17)
|
||||
++++++++++++++++++
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ Requests takes all of the work out of Python HTTP/1.1 — making your integrati
|
||||
Testimonials
|
||||
------------
|
||||
|
||||
Amazon, Google, Twilio, Mozilla, Heroku, PayPal, Obama for America, Transifex, Native Instruments, The Washington Post, Twitter, SoundCloud, Kippt, Readability, and Federal US Institutions use Requests internally. It has been downloaded over 1,000,000 times from PyPI.
|
||||
Amazon, Google, Twilio, Mozilla, Heroku, PayPal, NPR, Obama for America, Transifex, Native Instruments, The Washington Post, Twitter, SoundCloud, Kippt, Readability, and Federal US Institutions use Requests internally. It has been downloaded over 1,000,000 times from PyPI.
|
||||
|
||||
**Armin Ronacher**
|
||||
Requests is the perfect example how beautiful an API can be with the
|
||||
|
||||
@@ -42,8 +42,8 @@ is at <http://python-requests.org>.
|
||||
"""
|
||||
|
||||
__title__ = 'requests'
|
||||
__version__ = '1.0.0'
|
||||
__build__ = 0x01000
|
||||
__version__ = '1.0.2'
|
||||
__build__ = 0x01002
|
||||
__author__ = 'Kenneth Reitz'
|
||||
__license__ = 'Apache 2.0'
|
||||
__copyright__ = 'Copyright 2012 Kenneth Reitz'
|
||||
|
||||
@@ -13,7 +13,7 @@ import socket
|
||||
|
||||
from .models import Response
|
||||
from .auth import HTTPProxyAuth
|
||||
from .packages.urllib3.poolmanager import PoolManager
|
||||
from .packages.urllib3.poolmanager import PoolManager, proxy_from_url
|
||||
from .hooks import dispatch_hook
|
||||
from .compat import urlparse
|
||||
from .utils import DEFAULT_CA_BUNDLE_PATH, get_encoding_from_headers
|
||||
@@ -62,15 +62,7 @@ class HTTPAdapter(BaseAdapter):
|
||||
|
||||
# Allow self-specified cert location.
|
||||
if verify is not True:
|
||||
cert_loc = self.verify
|
||||
|
||||
# Look for configuration.
|
||||
if not cert_loc and self.config.get('trust_env'):
|
||||
cert_loc = os.environ.get('REQUESTS_CA_BUNDLE')
|
||||
|
||||
# Curl compatibility.
|
||||
if not cert_loc and self.config.get('trust_env'):
|
||||
cert_loc = os.environ.get('CURL_CA_BUNDLE')
|
||||
cert_loc = verify
|
||||
|
||||
if not cert_loc:
|
||||
cert_loc = DEFAULT_CA_BUNDLE_PATH
|
||||
@@ -127,7 +119,7 @@ class HTTPAdapter(BaseAdapter):
|
||||
proxy = proxies.get(urlparse(url).scheme)
|
||||
|
||||
if proxy:
|
||||
conn = self.poolmanager.ProxyManager(self.poolmanager.proxy_from_url(proxy))
|
||||
conn = proxy_from_url(proxy)
|
||||
else:
|
||||
conn = self.poolmanager.connection_from_url(url)
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ This module provides a Session object to manage and persist settings across
|
||||
requests (cookies, auth, proxies).
|
||||
|
||||
"""
|
||||
import os
|
||||
|
||||
from .compat import cookielib
|
||||
from .cookies import cookiejar_from_dict
|
||||
@@ -76,7 +77,7 @@ class SessionRedirectMixin(object):
|
||||
|
||||
resp.content # Consume socket so it can be released
|
||||
|
||||
if i > self.max_redirects:
|
||||
if i >= self.max_redirects:
|
||||
raise TooManyRedirects('Exceeded %s redirects.' % self.max_redirects)
|
||||
|
||||
# Release the connection back into the pool.
|
||||
@@ -226,6 +227,15 @@ class Session(SessionRedirectMixin):
|
||||
if not auth:
|
||||
auth = get_netrc_auth(url)
|
||||
|
||||
# Look for configuration.
|
||||
if not verify and verify is not False:
|
||||
verify = os.environ.get('REQUESTS_CA_BUNDLE')
|
||||
|
||||
# Curl compatibility.
|
||||
if not verify and verify is not False:
|
||||
verify = os.environ.get('CURL_CA_BUNDLE')
|
||||
|
||||
|
||||
# Merge all the kwargs.
|
||||
params = merge_kwargs(params, self.params)
|
||||
headers = merge_kwargs(headers, self.headers)
|
||||
|
||||
Reference in New Issue
Block a user