Skip to content

Commit

Permalink
feat: add user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminHalko committed Oct 14, 2023
1 parent f5b3b29 commit 2cde991
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/src/main/java/app/revanced/manager/di/HttpModule.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package app.revanced.manager.di

import android.content.Context
import app.revanced.manager.BuildConfig
import io.ktor.client.*
import io.ktor.client.engine.okhttp.*
import io.ktor.client.plugins.BrowserUserAgent
import io.ktor.client.plugins.HttpTimeout
import io.ktor.client.plugins.UserAgent
import io.ktor.client.plugins.contentnegotiation.*
import io.ktor.serialization.kotlinx.json.*
import kotlinx.serialization.json.Json
Expand Down Expand Up @@ -40,6 +43,9 @@ val httpModule = module {
install(HttpTimeout) {
socketTimeoutMillis = 10000
}
install(UserAgent) {
agent = "ReVanced-Manager/${BuildConfig.VERSION_CODE}"
}
}

fun provideJson() = Json {
Expand Down

0 comments on commit 2cde991

Please sign in to comment.