Skip to content

Add version name to header #3430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class FirebaseAppDistributionTesterApiClient {
private static final String INSTALLATION_AUTH_HEADER = "X-Goog-Firebase-Installations-Auth";
private static final String X_ANDROID_PACKAGE_HEADER_KEY = "X-Android-Package";
private static final String X_ANDROID_CERT_HEADER_KEY = "X-Android-Cert";
// Format of "X-Client-Version": "{ClientId}/{ClientVersion}"
private static final String X_CLIENT_VERSION_HEADER_KEY = "X-Client-Version";

private static final String BUILD_VERSION_JSON_KEY = "buildVersion";
private static final String DISPLAY_VERSION_JSON_KEY = "displayVersion";
Expand Down Expand Up @@ -69,7 +71,7 @@ class FirebaseAppDistributionTesterApiClient {
}

/**
* Fetches and returns the lastest release for the app that the tester has access to, or null if
* Fetches and returns the latest release for the app that the tester has access to, or null if
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice :)

* the tester doesn't have access to any releases.
*/
@Nullable
Expand Down Expand Up @@ -210,6 +212,8 @@ private HttpsURLConnection openHttpsUrlConnection(
httpsURLConnection.addRequestProperty(X_ANDROID_PACKAGE_HEADER_KEY, context.getPackageName());
httpsURLConnection.addRequestProperty(
X_ANDROID_CERT_HEADER_KEY, getFingerprintHashForPackage(context));
httpsURLConnection.addRequestProperty(
X_CLIENT_VERSION_HEADER_KEY, String.format("android-sdk/%s", BuildConfig.VERSION_NAME));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return httpsURLConnection;
}

Expand Down