Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore redirect statuses in Ktor engine #590

Merged
merged 2 commits into from
Feb 15, 2022

Conversation

ianbotsf
Copy link
Contributor

Issue #

aws-sdk-kotlin#527

Description of changes

Ktor clients follow redirects by default. This causes problems because some services (e.g., S3) use redirects (e.g., HTTP 301) to indicate non-retryable errors yet do not include enough standardized information (e.g., Location header) to allow a client to actually redirect.

This PR disables redirects in Ktor to allow the status code to bubble up to service-level error handling code and throw more actionable exceptions.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ianbotsf ianbotsf merged commit 6265f51 into main Feb 15, 2022
@ianbotsf ianbotsf deleted the fix-ktor-engine-redirects branch February 15, 2022 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants