File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1886,4 +1886,11 @@ def build_http():
18861886 http_timeout = socket .getdefaulttimeout ()
18871887 else :
18881888 http_timeout = DEFAULT_HTTP_TIMEOUT_SEC
1889- return httplib2 .Http (timeout = http_timeout )
1889+ http = httplib2 .Http (timeout = http_timeout )
1890+ # 308's are used by several Google APIs (Drive, YouTube)
1891+ # for Resumable Uploads rather than Permanent Redirects.
1892+ # This asks httplib2 to exclude 308s from the status codes
1893+ # it treats as redirects
1894+ http .redirect_codes = http .redirect_codes - {308 }
1895+
1896+ return http
Original file line number Diff line number Diff line change 3333packages = ["apiclient" , "googleapiclient" , "googleapiclient/discovery_cache" ]
3434
3535install_requires = [
36- "httplib2>=0.9.2 ,<1dev" ,
36+ "httplib2>=0.17.0 ,<1dev" ,
3737 "google-auth>=1.4.1" ,
3838 "google-auth-httplib2>=0.0.3" ,
3939 "six>=1.6.1,<2dev" ,
Original file line number Diff line number Diff line change @@ -1647,6 +1647,10 @@ def test_build_http_default_timeout_can_be_set_to_zero(self):
16471647 socket .setdefaulttimeout (0 )
16481648 http = build_http ()
16491649 self .assertEquals (http .timeout , 0 )
1650+
1651+ def test_build_http_default_308_is_excluded_as_redirect (self ):
1652+ http = build_http ()
1653+ self .assertTrue (308 not in http .redirect_codes )
16501654
16511655
16521656if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments