diff --git a/reposilite-backend/src/integration/kotlin/com/reposilite/web/BasePathIntegrationTest.kt b/reposilite-backend/src/integration/kotlin/com/reposilite/web/BasePathIntegrationTest.kt index ad4de9d74..bd56b2dfa 100644 --- a/reposilite-backend/src/integration/kotlin/com/reposilite/web/BasePathIntegrationTest.kt +++ b/reposilite-backend/src/integration/kotlin/com/reposilite/web/BasePathIntegrationTest.kt @@ -14,6 +14,8 @@ * limitations under the License. */ +@file:Suppress("FunctionName") + package com.reposilite.web import com.reposilite.RecommendedLocalSpecificationJunitExtension @@ -65,13 +67,18 @@ internal class BasePathIntegrationTest : ReposiliteSpecification() { .delete("$basePath/") { Unirest.delete(it.reposiliteLocation()).redirect(it) } .options("$basePath/") { Unirest.options(it.reposiliteLocation()).redirect(it) } .get("/stop") { await.countDown() } - .start(80) + .start(8080) await.await() } + private val restrictedHttpHeaders = listOf( + "Connection", + "Host", + ) + private fun > R.redirect(ctx: Context) { - ctx.headerMap().forEach { (key, value) -> header(key, value) } + ctx.headerMap().filter { it.key !in restrictedHttpHeaders }.forEach { (key, value) -> header(key, value) } val response = this.asBytes() response.headers.all().forEach { ctx.header(it.name, it.value) } ctx.status(response.status).result(response.body)