-
Notifications
You must be signed in to change notification settings - Fork 698
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
fix: add version in userAgent requestHeaders #1408
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GoogleUtils.VERSION might not work. It seems to be at 1.30.3 and should be at least 1.30.5, maybe 1.30.6.
Yes, it should be 1.30.5. That value should be auto incrementing with each release. I'll investigate that separately. |
@@ -126,7 +126,7 @@ protected AbstractGoogleClientRequest(AbstractGoogleClient abstractGoogleClient, | |||
// application name | |||
String applicationName = abstractGoogleClient.getApplicationName(); | |||
if (applicationName != null) { | |||
requestHeaders.setUserAgent(applicationName + " " + USER_AGENT_SUFFIX); | |||
requestHeaders.setUserAgent(applicationName + GoogleUtils.VERSION + " " + USER_AGENT_SUFFIX); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor - do you want to leave a space or delimiter between application name and version number?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The space here is correct, as it is a separate entry in the user-agent and the space is required.
...ent/src/main/java/com/google/api/client/googleapis/services/AbstractGoogleClientRequest.java
Outdated
Show resolved
Hide resolved
…is/services/AbstractGoogleClientRequest.java Co-Authored-By: BenWhitehead <BenWhitehead@users.noreply.github.com>
#1419 addresses the VERSION constant skew. It should also fix the line length checkstyle. |
I think this is mooted by #1425. |
Context:
Surface version in the User-Agent header. The change updates the userAgent value to include 'GoogleUtils.VERSION'.