fix: don't set http.redirect_codes if the attr doesn't exist and allow more httplib2 versions (#841)

* fix: don't set http.redirect_codes if the attr doesn't exist
* fix: widen permitted httplib2 versions
diff --git a/googleapiclient/http.py b/googleapiclient/http.py
index 719664d..cf9a509 100644
--- a/googleapiclient/http.py
+++ b/googleapiclient/http.py
@@ -1891,6 +1891,13 @@
     # for Resumable Uploads rather than Permanent Redirects.
     # This asks httplib2 to exclude 308s from the status codes
     # it treats as redirects
-    http.redirect_codes = http.redirect_codes - {308}
+    try:
+      http.redirect_codes = http.redirect_codes - {308}
+    except AttributeError:
+      # Apache Beam tests depend on this library and cannot
+      # currently upgrade their httplib2 version
+      # http.redirect_codes does not exist in previous versions
+      # of httplib2, so pass
+      pass
 
     return http
diff --git a/setup.py b/setup.py
index 82447e8..cf135a9 100644
--- a/setup.py
+++ b/setup.py
@@ -33,7 +33,10 @@
 packages = ["apiclient", "googleapiclient", "googleapiclient/discovery_cache"]
 
 install_requires = [
-    "httplib2>=0.17.0,<1dev",
+    # NOTE: Apache Beam tests depend on this library and cannot
+    # currently upgrade their httplib2 version.
+    # Please see https://github.com/googleapis/google-api-python-client/pull/841
+    "httplib2>=0.9.2,<1dev",
     "google-auth>=1.4.1",
     "google-auth-httplib2>=0.0.3",
     "google-api-core>=1.13.0,<2dev",