Skip to content

Commit d3aeffc

Browse files
author
rachaprince
authored
Add version name to header (#3430)
* Add version name to header * move comment above declaration
1 parent ee6e656 commit d3aeffc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

firebase-appdistribution/src/main/java/com/google/firebase/appdistribution/FirebaseAppDistributionTesterApiClient.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ class FirebaseAppDistributionTesterApiClient {
4242
private static final String INSTALLATION_AUTH_HEADER = "X-Goog-Firebase-Installations-Auth";
4343
private static final String X_ANDROID_PACKAGE_HEADER_KEY = "X-Android-Package";
4444
private static final String X_ANDROID_CERT_HEADER_KEY = "X-Android-Cert";
45+
// Format of "X-Client-Version": "{ClientId}/{ClientVersion}"
46+
private static final String X_CLIENT_VERSION_HEADER_KEY = "X-Client-Version";
4547

4648
private static final String BUILD_VERSION_JSON_KEY = "buildVersion";
4749
private static final String DISPLAY_VERSION_JSON_KEY = "displayVersion";
@@ -69,7 +71,7 @@ class FirebaseAppDistributionTesterApiClient {
6971
}
7072

7173
/**
72-
* Fetches and returns the lastest release for the app that the tester has access to, or null if
74+
* Fetches and returns the latest release for the app that the tester has access to, or null if
7375
* the tester doesn't have access to any releases.
7476
*/
7577
@Nullable
@@ -210,6 +212,8 @@ private HttpsURLConnection openHttpsUrlConnection(
210212
httpsURLConnection.addRequestProperty(X_ANDROID_PACKAGE_HEADER_KEY, context.getPackageName());
211213
httpsURLConnection.addRequestProperty(
212214
X_ANDROID_CERT_HEADER_KEY, getFingerprintHashForPackage(context));
215+
httpsURLConnection.addRequestProperty(
216+
X_CLIENT_VERSION_HEADER_KEY, String.format("android-sdk/%s", BuildConfig.VERSION_NAME));
213217
return httpsURLConnection;
214218
}
215219

0 commit comments

Comments
 (0)