mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2024-09-29 08:20:51 +00:00
User-Agent fix
include client version in user-agent
This commit is contained in:
parent
40aadf77f7
commit
b30fb1d9c7
@ -1,5 +1,6 @@
|
||||
package com.vitorpamplona.amethyst.service
|
||||
|
||||
import com.vitorpamplona.amethyst.BuildConfig
|
||||
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@ -43,7 +44,7 @@ class Nip05Verifier {
|
||||
withContext(Dispatchers.IO) {
|
||||
try {
|
||||
val request = Request.Builder()
|
||||
.header("User-Agent", "Amethyst")
|
||||
.header("User-Agent", "Amethyst " + BuildConfig.VERSION_NAME)
|
||||
.url(url)
|
||||
.build()
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.vitorpamplona.amethyst.service.lnurl
|
||||
|
||||
import com.vitorpamplona.amethyst.BuildConfig
|
||||
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@ -52,7 +53,7 @@ class LightningAddressResolver {
|
||||
|
||||
withContext(Dispatchers.IO) {
|
||||
val request: Request = Request.Builder()
|
||||
.header("User-Agent", "Amethyst")
|
||||
.header("User-Agent", "Amethyst " + BuildConfig.VERSION_NAME)
|
||||
.url(url)
|
||||
.build()
|
||||
|
||||
@ -95,7 +96,7 @@ class LightningAddressResolver {
|
||||
}
|
||||
|
||||
val request: Request = Request.Builder()
|
||||
.header("User-Agent", "Amethyst")
|
||||
.header("User-Agent", "Amethyst " + BuildConfig.VERSION_NAME)
|
||||
.url(url)
|
||||
.build()
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.vitorpamplona.amethyst.service.relays
|
||||
|
||||
import com.vitorpamplona.amethyst.BuildConfig
|
||||
import android.util.Log
|
||||
import com.google.gson.JsonElement
|
||||
import com.vitorpamplona.amethyst.service.model.Event
|
||||
@ -56,7 +57,7 @@ class Relay(
|
||||
|
||||
try {
|
||||
val request = Request.Builder()
|
||||
.header("User-Agent", "Amethyst")
|
||||
.header("User-Agent", "Amethyst " + BuildConfig.VERSION_NAME)
|
||||
.url(url.trim())
|
||||
.build()
|
||||
val listener = object : WebSocketListener() {
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.vitorpamplona.amethyst.ui.actions
|
||||
|
||||
import com.vitorpamplona.amethyst.BuildConfig
|
||||
import android.content.ContentResolver
|
||||
import android.content.ContentValues
|
||||
import android.content.Context
|
||||
@ -30,7 +31,7 @@ object ImageSaver {
|
||||
val client = OkHttpClient.Builder().build()
|
||||
|
||||
val request = Request.Builder()
|
||||
.header("User-Agent", "Amethyst")
|
||||
.header("User-Agent", "Amethyst " + BuildConfig.VERSION_NAME)
|
||||
.get()
|
||||
.url(url)
|
||||
.build()
|
||||
@ -137,5 +138,5 @@ object ImageSaver {
|
||||
MediaScannerConnection.scanFile(context, arrayOf(outputFile.toString()), null, null)
|
||||
}
|
||||
|
||||
private const val PICTURES_SUBDIRECTORY = "Amethyst"
|
||||
private const val PICTURES_SUBDIRECTORY = "Amethyst " + BuildConfig.VERSION_NAME
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.vitorpamplona.amethyst.ui.actions
|
||||
|
||||
import com.vitorpamplona.amethyst.BuildConfig
|
||||
import android.content.ContentResolver
|
||||
import android.net.Uri
|
||||
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
|
||||
@ -44,7 +45,7 @@ object ImageUploader {
|
||||
|
||||
val request: Request = Request.Builder()
|
||||
.header("Authorization", "Client-ID e6aea87296f3f96")
|
||||
.header("User-Agent", "Amethyst")
|
||||
.header("User-Agent", "Amethyst " + BuildConfig.VERSION_NAME)
|
||||
.url("https://api.imgur.com/3/image")
|
||||
.post(requestBody)
|
||||
.build()
|
||||
|
Loading…
Reference in New Issue
Block a user