Skip to content

Commit

Permalink
[3.x.x][client] Remove duplicate header (#867)
Browse files Browse the repository at this point in the history
* Remove duplicate header

Copy changes over from #865 to `3.x.x` branch

* Update GraphQLClient.kt

* Update GraphQLClient.kt
  • Loading branch information
smyrick authored Sep 4, 2020
1 parent ad082b1 commit b66d30e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import io.ktor.client.engine.cio.CIOEngineConfig
import io.ktor.client.features.json.JacksonSerializer
import io.ktor.client.features.json.JsonFeature
import io.ktor.client.request.HttpRequestBuilder
import io.ktor.client.request.accept
import io.ktor.client.request.post
import io.ktor.http.ContentType
import io.ktor.http.contentType
Expand Down Expand Up @@ -82,7 +81,6 @@ open class GraphQLClient<in T : HttpClientEngineConfig>(

val rawResult = client.post<String>(url) {
apply(requestBuilder)
accept(ContentType.Application.Json)
contentType(ContentType.Application.Json)
body = graphQLRequest
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import io.ktor.client.engine.cio.CIO
import io.ktor.client.engine.cio.endpoint
import io.ktor.client.features.ClientRequestException
import io.ktor.client.features.json.JsonFeature
import io.ktor.client.request.accept
import io.ktor.client.request.header
import io.ktor.client.request.post
import io.ktor.client.request.url
Expand All @@ -51,7 +50,6 @@ suspend fun introspectSchema(endpoint: String, httpHeaders: Map<String, Any> = e
client.post<Map<String, Any?>> {
url(endpoint)
contentType(ContentType.Application.Json)
accept(ContentType.Application.Json)
httpHeaders.forEach { (name, value) ->
header(name, value)
}
Expand Down

0 comments on commit b66d30e

Please sign in to comment.