mirror of
https://github.com/kennethreitz/requests3.git
synced 2026-06-05 23:10:16 +00:00
Merge pull request #983 from jszakmeister/allow-strict
Add the ability to turn off HTTP 0.9 support.
This commit is contained in:
+1
-1
@@ -42,7 +42,7 @@ def request(method, url, **kwargs):
|
||||
adhoc_session = False
|
||||
session = kwargs.pop('session', None)
|
||||
if session is None:
|
||||
session = sessions.session()
|
||||
session = sessions.session(config=kwargs.get('config', None))
|
||||
adhoc_session = True
|
||||
|
||||
try:
|
||||
|
||||
@@ -43,3 +43,4 @@ defaults['keep_alive'] = True
|
||||
defaults['encode_uri'] = True
|
||||
defaults['trust_env'] = True
|
||||
defaults['store_cookies'] = True
|
||||
defaults['support_http0.9'] = True
|
||||
|
||||
@@ -125,7 +125,8 @@ class Session(object):
|
||||
def init_poolmanager(self):
|
||||
self.poolmanager = PoolManager(
|
||||
num_pools=self.config.get('pool_connections'),
|
||||
maxsize=self.config.get('pool_maxsize')
|
||||
maxsize=self.config.get('pool_maxsize'),
|
||||
strict=not self.config.get('support_http0.9')
|
||||
)
|
||||
|
||||
def __repr__(self):
|
||||
|
||||
Reference in New Issue
Block a user