This repository was archived by the owner on Apr 2, 2026. It is now read-only.
fix: add nio entry to user-agent#774
Merged
Merged
Conversation
frankyn
reviewed
Dec 13, 2021
frankyn
reviewed
Dec 14, 2021
frankyn
suggested changes
Dec 14, 2021
| private static class NioUserAgentEntryHeaderProvider extends FixedHeaderProvider { | ||
|
|
||
| private final ImmutableMap<String, String> userAgent = | ||
| ImmutableMap.of("user-agent", String.format("gcloud-java-nio/%s", VERSION)); |
Contributor
There was a problem hiding this comment.
Does this prepend to the existing user-agent?
Collaborator
Author
There was a problem hiding this comment.
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)
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.