> +            // key manager)
> +            
> client.setSslSocketFactory(sslContextSupplier.get().getSocketFactory());
> +         } else if (utils.trustAllCerts()) {
> +            
> client.setSslSocketFactory(untrustedSSLContextProvider.get().getSocketFactory());
> +         }
> +      }
> +      return client.open(url);
> +   }
> +
> +   @Override
> +   protected void configureRequestHeaders(HttpURLConnection connection, 
> HttpRequest request) {
> +      super.configureRequestHeaders(connection, request);
> +      // OkHttp does not set the Accept header if not present in the request.
> +      // Make sure we send a flexible one.
> +      if (request.getFirstHeaderOrNull(HttpHeaders.ACCEPT) == null) {
> +         connection.setRequestProperty(HttpHeaders.ACCEPT, "*/*");

I think it is safe to have it here. The spec says that not sending the Accept 
header is equivalent to send it with an `*/*` value, so it shouldn't be a 
problem to set it if it hasn't been explicitly defined.

Keeping this would allow us to use this driver in other existing jclouds APIs 
that currently don't set the header and are now working just because the 
default JRE implementation adds it. WDYT?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/232/files#r8631270

Reply via email to