Skip to content

Commit

Permalink
fix: do not manually add application/json, it's already added
Browse files Browse the repository at this point in the history
probably by using Json ContentNegotiation
  • Loading branch information
David Ly committed Sep 6, 2023
1 parent 162c825 commit 34fcf06
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ import io.ktor.client.plugins.auth.Auth
import io.ktor.client.plugins.auth.providers.BearerTokens
import io.ktor.client.plugins.auth.providers.bearer
import io.ktor.client.plugins.defaultRequest
import io.ktor.client.request.header
import ly.david.data.musicbrainz.auth.MusicBrainzAuthRepository

private const val MUSIC_BRAINZ_API_BASE_URL = "$MUSIC_BRAINZ_BASE_URL/ws/2/"
private const val USER_AGENT_VALUE = "MusicSearch (https://github.com/lydavid/MusicSearch)"
private const val ACCEPT = "Accept"
private const val ACCEPT_VALUE = "application/json"

interface MusicBrainzApi : SearchApi, BrowseApi, LookupApi, CollectionApi, MusicBrainzUserApi {
companion object {
Expand All @@ -23,7 +20,6 @@ interface MusicBrainzApi : SearchApi, BrowseApi, LookupApi, CollectionApi, Music
val extendedClient = httpClient.config {
defaultRequest {
url(MUSIC_BRAINZ_API_BASE_URL)
header(ACCEPT, ACCEPT_VALUE)
}
install(UserAgent) {
agent = USER_AGENT_VALUE
Expand Down

0 comments on commit 34fcf06

Please sign in to comment.