-
Notifications
You must be signed in to change notification settings - Fork 33
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 nio entry to user-agent #774
Conversation
...d-nio/src/main/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProvider.java
Outdated
Show resolved
Hide resolved
...o/src/test/java/com/google/cloud/storage/contrib/nio/CloudStorageFileSystemProviderTest.java
Outdated
Show resolved
Hide resolved
private static class NioUserAgentEntryHeaderProvider extends FixedHeaderProvider { | ||
|
||
private final ImmutableMap<String, String> userAgent = | ||
ImmutableMap.of("user-agent", String.format("gcloud-java-nio/%s", VERSION)); |
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.
Does this prepend to the existing user-agent?
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.
It does. This is what it looks like in the logs (the version is missing because I ran it from my ide without the version file artifact
User-Agent: gcloud-java-nio/0.123.18-SNAPSHOT gcloud-java/2.2.1 Google-API-Java-Client/1.32.2 Google-HTTP-Java-Client/1.40.1 (gzip)
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.
LGTM
Move version information and configuration of header into StorageOptionsUtil Introduce StorageOptionsUtil which provides utilities and default instance access for StorageOptions which include our new user-agent entry. To all tests which called com.google.cloud.storage.contrib.nio.CloudStorageFileSystemProvider.setStorageOptions in their @before, there is now a corresponding @after which sets the storageOptions back to defaults
No description provided.