Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

fix: Make x-goog-api-client header report rest-based transport clients with rest/ token instead of httpson/ #1370

Merged
merged 1 commit into from May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -36,15 +36,15 @@
@InternalApi
public class GaxHttpJsonProperties {
private static final Pattern DEFAULT_API_CLIENT_HEADER_PATTERN =
Pattern.compile("gl-java/.+ gapic/.* gax/.+ httpjson/.*");
Pattern.compile("gl-java/.+ gapic/.* gax/.+ rest/.*");

/** Returns default api client header pattern (to facilitate testing) */
public static Pattern getDefaultApiClientHeaderPattern() {
return DEFAULT_API_CLIENT_HEADER_PATTERN;
}

public static String getHttpJsonTokenName() {
return "httpjson";
return "rest";
}

public static String getHttpJsonVersion() {
Expand Down
Expand Up @@ -41,7 +41,7 @@ public class GaxHttpJsonPropertiesTest {
public void testDefaultHeaderPattern() {
assertTrue(
GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
.matcher("gl-java/1.8_00 gapic/1.2.3-alpha gax/1.5.0 httpjson/1.7.0")
.matcher("gl-java/1.8_00 gapic/1.2.3-alpha gax/1.5.0 rest/1.7.0")
.matches());
}
}