Allow customizing user agent without USER_AGENT_SUFFIX #53
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
From mingfai...@gmail.com on November 21, 2011 23:01:37
version: Google-HTTP-Java-Client/1.6.0-beta
could the library allow us to completely customize the user agent without the hardcoded suffix? https://code.google.com/p/google-http-java-client/source/browse/google-http-client/src/main/java/com/google/api/client/http/HttpRequest.java {code}
public static final String USER_AGENT_SUFFIX =
"Google-HTTP-Java-Client/" + Strings.VERSION + " (gzip)";
...
// add to user agent
if (headers.getUserAgent() == null) {
headers.setUserAgent(USER_AGENT_SUFFIX);
} else {
headers.setUserAgent(headers.getUserAgent() + " " + USER_AGENT_SUFFIX);
}
{code}
I propose just to remove the else case above. IMHO, it is a good practice to use User-Agent http header like that, but as a library, there should be an option for us not to follow the good practice. what do you think?
Original issue: http://code.google.com/p/google-http-java-client/issues/detail?id=53
The text was updated successfully, but these errors were encountered: