Skip to content
Permalink
Browse files

Fix cookies and parameters duplication

  • Loading branch information...
e5l committed Oct 15, 2018
1 parent 320eddb commit 34cde46edcc2d7ceacb8917737df3821990d05ec
@@ -1,4 +1,5 @@
import io.ktor.client.engine.mock.*
import io.ktor.client.features.*
import io.ktor.client.features.cookies.*
import io.ktor.client.request.*
import io.ktor.client.response.*
@@ -33,6 +33,8 @@ class HttpRedirect {

call = execute(HttpRequestBuilder().apply {
takeFrom(origin.request)
url.parameters.clear()

location?.let { url.takeFrom(it) }
})

@@ -52,7 +52,7 @@ class HttpCookies(private val storage: CookiesStorage) {
val cookies = feature.get(context.url.clone().build())

with(context) {
header(HttpHeaders.Cookie, renderClientCookies(cookies))
headers[HttpHeaders.Cookie] = renderClientCookies(cookies)
}
}

@@ -14,7 +14,6 @@ import io.ktor.server.engine.*
import io.ktor.server.jetty.*
import kotlinx.coroutines.*
import kotlin.test.*
import kotlin.test.Test


open class HttpRedirectTest(private val factory: HttpClientEngineFactory<*>) : TestWithKtor() {

0 comments on commit 34cde46

Please sign in to comment.
You can’t perform that action at this time.