Skip to content

Redirect handling not quite right? #397

@ericphanson

Description

@ericphanson

In #389 I added a throw if we could not set the URL from the returned location, but did not change the behavior otherwise.

But I'm not quite sure that original behavior was right: it seems like we set the URL in the request, but if nothing throws, we just continue on our way. I assumed that we would automatically retry with the new URL, but that was a misunderstanding of @retry. If there is no error, it does not retry. So I don't think setting the URL does much, since we don't use it to make another request.

I'm not really sure though when we will get a redirect from AWS that we want to follow; when you have the wrong region, we get 302s (without a location parameter sent back), but I'm not sure in what other circumstances it happens. On my #396 branch I have seen this code path triggered by

AWSServices.sts(
                             "AssumeRoleWithWebIdentity",
                             Dict(
                                 "RoleArn" => role_arn, # an actual role arn
                                 "RoleSessionName" => "test",
                                 "WebIdentityToken" => "123", # made up
                             );
                             aws_config=AWSConfig(creds=nothing)

but I don't know why-- AWS should be returning an error code about the WebIdentityToken being bad, not a redirect, like it does on master.

Also, I'm not sure why we don't use redirect=true in our HTTP stack, if we do want to follow redirects.

cc @omus

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions