Set Android client

This checks user-agent before X-OmnivoreClient so the more explicit
X-OmnivoreClient overrides the derived client being set from user
agent.
This commit is contained in:
Jackson Harper
2024-07-05 20:15:20 +08:00
parent fbff86f48f
commit 180efb4846
3 changed files with 11 additions and 7 deletions

View File

@ -17,5 +17,7 @@ class Networker @Inject constructor(
private suspend fun authToken() = datastoreRepo.getString(omnivoreAuthToken) ?: ""
suspend fun authenticatedApolloClient() = ApolloClient.Builder().serverUrl(serverUrl())
.addHttpHeader("Authorization", value = authToken()).build()
.addHttpHeader("Authorization", value = authToken())
.addHttpHeader("X-OmnivoreClient", value = "android")
.build()
}