Follows UserAgent version syntax: User-Agent: <product> / <product-version> <comment>

This commit is contained in:
Vitor Pamplona
2023-03-20 08:41:03 -04:00
parent d62a2480f4
commit 2d693145d9
5 changed files with 11 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
package com.vitorpamplona.amethyst.service
import com.vitorpamplona.amethyst.BuildConfig
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.vitorpamplona.amethyst.BuildConfig
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
@@ -44,7 +44,7 @@ class Nip05Verifier {
withContext(Dispatchers.IO) {
try {
val request = Request.Builder()
.header("User-Agent", "Amethyst " + BuildConfig.VERSION_NAME)
.header("User-Agent", "Amethyst/${BuildConfig.VERSION_NAME}")
.url(url)
.build()

View File

@@ -1,7 +1,7 @@
package com.vitorpamplona.amethyst.service.lnurl
import com.vitorpamplona.amethyst.BuildConfig
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.vitorpamplona.amethyst.BuildConfig
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
@@ -53,7 +53,7 @@ class LightningAddressResolver {
withContext(Dispatchers.IO) {
val request: Request = Request.Builder()
.header("User-Agent", "Amethyst " + BuildConfig.VERSION_NAME)
.header("User-Agent", "Amethyst/${BuildConfig.VERSION_NAME}")
.url(url)
.build()
@@ -96,7 +96,7 @@ class LightningAddressResolver {
}
val request: Request = Request.Builder()
.header("User-Agent", "Amethyst " + BuildConfig.VERSION_NAME)
.header("User-Agent", "Amethyst/${BuildConfig.VERSION_NAME}")
.url(url)
.build()

View File

@@ -1,8 +1,8 @@
package com.vitorpamplona.amethyst.service.relays
import com.vitorpamplona.amethyst.BuildConfig
import android.util.Log
import com.google.gson.JsonElement
import com.vitorpamplona.amethyst.BuildConfig
import com.vitorpamplona.amethyst.service.model.Event
import com.vitorpamplona.amethyst.service.model.EventInterface
import okhttp3.OkHttpClient
@@ -57,7 +57,7 @@ class Relay(
try {
val request = Request.Builder()
.header("User-Agent", "Amethyst " + BuildConfig.VERSION_NAME)
.header("User-Agent", "Amethyst/${BuildConfig.VERSION_NAME}")
.url(url.trim())
.build()
val listener = object : WebSocketListener() {

View File

@@ -1,6 +1,5 @@
package com.vitorpamplona.amethyst.ui.actions
import com.vitorpamplona.amethyst.BuildConfig
import android.content.ContentResolver
import android.content.ContentValues
import android.content.Context
@@ -9,6 +8,7 @@ import android.os.Build
import android.os.Environment
import android.provider.MediaStore
import androidx.annotation.RequiresApi
import com.vitorpamplona.amethyst.BuildConfig
import okhttp3.*
import okio.BufferedSource
import okio.IOException
@@ -31,7 +31,7 @@ object ImageSaver {
val client = OkHttpClient.Builder().build()
val request = Request.Builder()
.header("User-Agent", "Amethyst " + BuildConfig.VERSION_NAME)
.header("User-Agent", "Amethyst/${BuildConfig.VERSION_NAME}")
.get()
.url(url)
.build()

View File

@@ -1,9 +1,9 @@
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
import com.vitorpamplona.amethyst.BuildConfig
import okhttp3.*
import okhttp3.MediaType.Companion.toMediaType
import okio.BufferedSink
@@ -45,7 +45,7 @@ object ImageUploader {
val request: Request = Request.Builder()
.header("Authorization", "Client-ID e6aea87296f3f96")
.header("User-Agent", "Amethyst " + BuildConfig.VERSION_NAME)
.header("User-Agent", "Amethyst/${BuildConfig.VERSION_NAME}")
.url("https://api.imgur.com/3/image")
.post(requestBody)
.build()