]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Fix #1146 Set default allow_redirects to true (#1183)
authorSkyler Dong <dongskyler@gmail.com>
Sun, 16 Aug 2020 05:33:46 +0000 (00:33 -0500)
committerGitHub <noreply@github.com>
Sun, 16 Aug 2020 05:33:46 +0000 (07:33 +0200)
* Set default allow_redirects to true

* Set default allow_redirects to true

* Fix line-too-long linting error by removing comments

httpx/_api.py
httpx/_client.py

index a300f633e7ace1d0876a39735bf9af0c7ac64336..4c608f0622dd58adc7d533fd16f64710c7a7f0a8 100644 (file)
@@ -214,7 +214,7 @@ def head(
     headers: HeaderTypes = None,
     cookies: CookieTypes = None,
     auth: AuthTypes = None,
-    allow_redirects: bool = False,  # Note: Differs to usual default.
+    allow_redirects: bool = True,
     cert: CertTypes = None,
     verify: VerifyTypes = True,
     timeout: TimeoutTypes = DEFAULT_TIMEOUT_CONFIG,
index e3b2f5b31913f210491a6c5fc2bff1c454833440..53d52e5123c82e58bb154626619fbf45898bc6d5 100644 (file)
@@ -849,7 +849,7 @@ class Client(BaseClient):
         headers: HeaderTypes = None,
         cookies: CookieTypes = None,
         auth: typing.Union[AuthTypes, UnsetType] = UNSET,
-        allow_redirects: bool = False,  # NOTE: Differs to usual default.
+        allow_redirects: bool = True,
         timeout: typing.Union[TimeoutTypes, UnsetType] = UNSET,
     ) -> Response:
         """
@@ -1453,7 +1453,7 @@ class AsyncClient(BaseClient):
         headers: HeaderTypes = None,
         cookies: CookieTypes = None,
         auth: typing.Union[AuthTypes, UnsetType] = UNSET,
-        allow_redirects: bool = False,  # NOTE: Differs to usual default.
+        allow_redirects: bool = True,
         timeout: typing.Union[TimeoutTypes, UnsetType] = UNSET,
     ) -> Response:
         """