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

Commit

Permalink
fix: Make x-goog-api-client header report rest-based transport client…
Browse files Browse the repository at this point in the history
…s 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`
  • Loading branch information
vam-google authored May 7, 2021
1 parent 3bae27c commit b1b0b49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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());
}
}

0 comments on commit b1b0b49

Please sign in to comment.