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

Commit b1b0b49

Browse files
authored
fix: Make x-goog-api-client header report rest-based transport clients with rest/ token instead of httpson/. (#1370)
We will still be able to disambiguate between discogapic and diregapic for compute by the `gapic/` token in the same header. Discogapic clients will be versioned as 0.x.x, while diregapics are `1.x.x-alpha`
1 parent 3bae27c commit b1b0b49

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

gax-httpjson/src/main/java/com/google/api/gax/httpjson/GaxHttpJsonProperties.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@
3636
@InternalApi
3737
public class GaxHttpJsonProperties {
3838
private static final Pattern DEFAULT_API_CLIENT_HEADER_PATTERN =
39-
Pattern.compile("gl-java/.+ gapic/.* gax/.+ httpjson/.*");
39+
Pattern.compile("gl-java/.+ gapic/.* gax/.+ rest/.*");
4040

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

4646
public static String getHttpJsonTokenName() {
47-
return "httpjson";
47+
return "rest";
4848
}
4949

5050
public static String getHttpJsonVersion() {

gax-httpjson/src/test/java/com/google/api/gax/httpjson/GaxHttpJsonPropertiesTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class GaxHttpJsonPropertiesTest {
4141
public void testDefaultHeaderPattern() {
4242
assertTrue(
4343
GaxHttpJsonProperties.getDefaultApiClientHeaderPattern()
44-
.matcher("gl-java/1.8_00 gapic/1.2.3-alpha gax/1.5.0 httpjson/1.7.0")
44+
.matcher("gl-java/1.8_00 gapic/1.2.3-alpha gax/1.5.0 rest/1.7.0")
4545
.matches());
4646
}
4747
}

0 commit comments

Comments
 (0)