Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customizing user agent without USER_AGENT_SUFFIX #53

Closed
wonderfly opened this issue Jan 9, 2015 · 3 comments
Closed

Allow customizing user agent without USER_AGENT_SUFFIX #53

wonderfly opened this issue Jan 9, 2015 · 3 comments
Assignees
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.

Comments

@wonderfly
Copy link
Contributor

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

@wonderfly wonderfly added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. imported priority: p2 Moderately-important priority. Fix may not be included in next release. labels Jan 9, 2015
@wonderfly wonderfly self-assigned this Jan 9, 2015
@wonderfly
Copy link
Contributor Author

From yan...@google.com on July 26, 2012 06:52:39

Perhaps we should add a setSuppressUserAgentSuffix(boolean) method to HttpRequest which is false by default?

Feedback from Alexey Zakharov on 7/19/2012: https://groups.google.com/forum/?fromgroups#!topic/google-http-java-client/A-JFuFWAw_k "
Current implementation make it impossible to remove google http client suffix from UserAgent.
Could you please make it optional, because it breaks our company guidelines.
"

Status: Accepted
Owner: rmis...@google.com
Cc: yan...@google.com
Labels: Milestone-Version1.11.0 Component-HTTP

@wonderfly
Copy link
Contributor Author

From rmis...@google.com on July 26, 2012 08:30:42

http://codereview.appspot.com/6448055/

Status: Started

@wonderfly
Copy link
Contributor Author

From rmis...@google.com on August 07, 2012 07:05:01

Status: Fixed

clundin25 pushed a commit to clundin25/google-http-java-client that referenced this issue Aug 11, 2022
add accessor methods to UserCredentials
daniel-lopes-optimizely referenced this issue in looker-open-source/sdk-codegen Jan 8, 2024
* Replace ktor with Google Java HTTP client

* Remove ktor and clean up methods

* Disable cookie management for Apache transport
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

1 participant