spring-attic / spring-social

Allows you to connect your applications with SaaS providers such as Facebook and Twitter.
http://projects.spring.io/spring-social
Apache License 2.0
619 stars 351 forks source link

ClientHttpRequestFactorySelector should only use proxy if system property is non-blank #140

Closed oyvindhorneland closed 5 years ago

oyvindhorneland commented 10 years ago

Hi,

https://github.com/spring-projects/spring-social/blob/1.0.3.RELEASE/spring-social-core/src/main/java/org/springframework/social/support/ClientHttpRequestFactorySelector.java

ClientHttpRequestFactorySelector will try to create a proxy if the system property "http.proxyHost" is set to "" (empty String) as it only checks if it's not null. While it probably shouldn't be set as blank in the first place, this module would be more robust if it only created proxy for a non-empty value.

As an example, http://hg.openjdk.java.net/jdk7/jdk7/jdk/file/9b8c96f96a0f/src/share/classes/sun/net/spi/DefaultProxySelector.java will only use proxy if non-empty.