Skip to content

Add a redirect userinfo-stripping test for an IPv6 literal host #20

Description

@OmarAlJarrah

DefaultRedirectStep.stripUserInfo now rebuilds the URI textually from its raw components to preserve percent-encoding in the path and query:

sb.append(uri.scheme).append("://").append(uri.host)
if (uri.port !=-1) sb.append(':').append(uri.port)
uri.rawPath?.let { sb.append(it) }
...

(sdk-core/src/main/kotlin/org/dexpace/sdk/core/http/pipeline/steps/DefaultRedirectStep.kt)

URI.getHost() returns the bracketed [::1] form for an IPv6 literal, so the textual rebuild should round-trip correctly — but there is no test covering an IPv6 Location. The new test covers the percent-encoded path/query case only, so the IPv6 host path is unverified.

Action

Add a redirect test where the Location carries userinfo and an IPv6 literal host (e.g. https://user:pass@[::1]:8443/p?x=1) and assert the reissued URL keeps [::1]:8443 (and the path/query) and drops the userinfo.

Code added on fix/http-stack-correctness-resource-safety (#13).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions