pitrou commented on a change in pull request #8261:
URL: https://github.com/apache/arrow/pull/8261#discussion_r494496745



##########
File path: cpp/src/arrow/filesystem/s3fs.cc
##########
@@ -459,6 +459,24 @@ class S3Client : public Aws::S3::S3Client {
   }
 };
 
+// In AWS SDK < 1.8, Aws::Client::ClientConfiguration is a bool.
+// In AWS SDK >= 1.8, it's a Aws::Client::FollowRedirectsPolicy scoped enum.
+static constexpr bool HaveLegacyFollowRedirects =
+    std::is_same<bool,
+                 
decltype(Aws::Client::ClientConfiguration().followRedirects)>::value;
+
+template <typename Config = Aws::Client::ClientConfiguration>
+void DisableRedirects(
+    typename std::enable_if<HaveLegacyFollowRedirects, Config*>::type config) {
+  config->followRedirects = false;
+}
+
+template <typename Config = Aws::Client::ClientConfiguration>
+void DisableRedirects(
+    typename std::enable_if<!HaveLegacyFollowRedirects, Config*>::type config) 
{
+  config->followRedirects = decltype(config->followRedirects)::NEVER;
+}
+

Review comment:
       `if constexpr` would have been nice...




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to