Skip to content

Commit

Permalink
Handle empty path in AWS_CONTAINER_CREDENTIALS_FULL_URI (#225)
Browse files Browse the repository at this point in the history
Signed-off-by: James Bornholt <bornholt@amazon.com>
  • Loading branch information
jamesbornholt committed Jan 22, 2024
1 parent 7911fa2 commit 534b445
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion source/credentials_provider_default_chain.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,16 @@ static struct aws_credentials_provider *s_aws_credentials_provider_new_ecs_or_im
goto clean_up;
}

struct aws_byte_cursor path_and_query = uri.path_and_query;
if (path_and_query.len == 0) {
path_and_query = aws_byte_cursor_from_c_str("/");
}

struct aws_credentials_provider_ecs_options ecs_options = {
.shutdown_options = *shutdown_options,
.bootstrap = bootstrap,
.host = uri.host_name,
.path_and_query = uri.path_and_query,
.path_and_query = path_and_query,
.tls_ctx = aws_byte_cursor_eq_c_str_ignore_case(&(uri.scheme), "HTTPS") ? tls_ctx : NULL,
.auth_token = auth_token_cursor,
.port = uri.port,
Expand Down

0 comments on commit 534b445

Please sign in to comment.