-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MOBILE-1859: Add additional information into the user-agent header (#93)
- Loading branch information
1 parent
2570891
commit a3b45fc
Showing
5 changed files
with
41 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
common/src/main/java/eu/kevin/common/helpers/WebFrameHeadersHelper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package eu.kevin.common.helpers | ||
|
||
import eu.kevin.common.BuildConfig | ||
|
||
object WebFrameHeadersHelper { | ||
|
||
private const val KEVIN_SDK_VERSION_KEY = "KevinAndroidSdk" | ||
|
||
fun appendTelemetryInfoToUserAgent(originalUserAgent: String): String { | ||
return originalUserAgent | ||
.addUserAgentDataField(key = KEVIN_SDK_VERSION_KEY, value = BuildConfig.KEVIN_SDK_VERSION) | ||
} | ||
|
||
private fun String.addUserAgentDataField(key: String, value: String): String { | ||
return this.plus(" $key/$value") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters