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

fix: add version in userAgent requestHeaders #1408

Closed

Conversation

jsimonweb
Copy link

@jsimonweb jsimonweb commented Nov 4, 2019

Context:
Surface version in the User-Agent header. The change updates the userAgent value to include 'GoogleUtils.VERSION'.

@jsimonweb jsimonweb requested a review from a team as a code owner November 4, 2019 19:03
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 4, 2019
Copy link
Contributor

@elharo elharo left a 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.

@kolea2
Copy link

kolea2 commented Nov 4, 2019

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);
Copy link

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?

Copy link
Contributor

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.

…is/services/AbstractGoogleClientRequest.java

Co-Authored-By: BenWhitehead <BenWhitehead@users.noreply.github.com>
@chingor13
Copy link
Collaborator

#1419 addresses the VERSION constant skew. It should also fix the line length checkstyle.

@elharo
Copy link
Contributor

elharo commented Nov 20, 2019

I think this is mooted by #1425.

@elharo elharo closed this Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants