From 1f863a1e838fc2cb3d8562cf87738c9394b3f68a Mon Sep 17 00:00:00 2001 From: Eric Davies Date: Mon, 29 Jan 2018 14:27:01 -0600 Subject: [PATCH] Get instance credentials working with HTTP 0.6 --- src/AWSCredentials.jl | 4 ++-- src/http.jl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/AWSCredentials.jl b/src/AWSCredentials.jl index 2651fac..0330719 100644 --- a/src/AWSCredentials.jl +++ b/src/AWSCredentials.jl @@ -170,7 +170,7 @@ function ec2_metadata(key) @assert localhost_is_ec2() - String(take!(http_get("http://169.254.169.254/latest/meta-data/$key"))) + String(http_get("http://169.254.169.254/latest/meta-data/$key").body) end @@ -216,7 +216,7 @@ function ecs_instance_credentials() uri = ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"] - new_creds = JSON.parse(String(take!(http_get("http://169.254.170.2$uri")))) + new_creds = JSON.parse(String(http_get("http://169.254.170.2$uri").body)) if debug_level > 0 print("Loading AWSCredentials from ECS metadata... ") diff --git a/src/http.jl b/src/http.jl index 9601aaf..1222074 100644 --- a/src/http.jl +++ b/src/http.jl @@ -56,7 +56,7 @@ end function http_get(url::String) - host = HTTP.URIs.hostname(HTTP.URI(url)) + host = HTTP.URI(url).host http_request(@SymDict(verb = "GET", url = url,