Skip to content

Commit 6265f51

Browse files
authored
fix: ignore redirect statuses in Ktor engine (#590)
1 parent 158353e commit 6265f51

File tree

1 file changed

+4
-0
lines changed
  • runtime/protocol/http-client-engines/http-client-engine-ktor/jvm/src/aws/smithy/kotlin/runtime/http/engine/ktor

1 file changed

+4
-0
lines changed

runtime/protocol/http-client-engines/http-client-engine-ktor/jvm/src/aws/smithy/kotlin/runtime/http/engine/ktor/KtorEngine.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ actual class KtorEngine actual constructor(
7272

7373
// do not throw exceptions if status code < 300, error handling is expected by generated clients
7474
expectSuccess = false
75+
76+
// do not attempt to follow redirects for status codes like 301 because they should be handled higher up
77+
followRedirects = false
7578
}
79+
7680
private val logger = Logger.getLogger<KtorEngine>()
7781

7882
// TODO: Remove following annotation after https://youtrack.jetbrains.com/issue/KTOR-3001 is resolved

0 commit comments

Comments
 (0)