Skip to content

Commit

Permalink
Merge pull request #665 from DrewCarlson/drew/js-rebase
Browse files Browse the repository at this point in the history
Properly construct request headers in JS engine
  • Loading branch information
cy6erGn0m committed Oct 22, 2018
2 parents e788f34 + 42b5958 commit 9420e0e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.ktor.client.engine.js

import io.ktor.client.engine.mergeHeaders
import io.ktor.client.request.*
import io.ktor.http.*
import io.ktor.http.content.*
Expand All @@ -13,8 +14,8 @@ import kotlin.coroutines.*

internal suspend fun HttpRequest.toRaw(): RequestInit {
val jsHeaders = js("({})")
headers.forEach { key, values ->
jsHeaders[key] = values
mergeHeaders(headers, content) { key, value ->
jsHeaders[key] = value
}

val content = content
Expand Down

0 comments on commit 9420e0e

Please sign in to comment.