add :head method to guards
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
diff --git a/lib/hubic/hubic_api/auth.ex b/lib/hubic/hubic_api/auth.ex
index 9ca8886..2623160 100644
--- a/lib/hubic/hubic_api/auth.ex
+++ b/lib/hubic/hubic_api/auth.ex
@@ -15,7 +15,7 @@ defmodule ExOvh.Hubic.HubicApi.Auth do
:: ExOvh.Client.query_t
def prepare_request(client, query)
- def prepare_request(client, {method, uri, params} = query) when method in [:get, :delete] do
+ def prepare_request(client, {method, uri, params} = query) when method in [:get, :head, :delete] do
config = config(client)
uri = uri(config, uri)
if params !== :nil and params !== "" and is_map(params), do: uri = uri <> "?" <> URI.encode_query(params)
@@ -78,7 +78,7 @@ defmodule ExOvh.Hubic.HubicApi.Auth do
defp headers(client, method) when method in [:post, :put] do
Map.merge(default_headers(client), %{ "Content-Type": "application/json;charset=utf-8" })
end
- defp headers(client, method) when method in [:get, :delete], do: default_headers(client)
+ defp headers(client, method) when method in [:get, :head, :delete], do: default_headers(client)
defp config(), do: Cache.get_config(ExOvh)
defp config(client), do: Cache.get_config(client)
diff --git a/lib/hubic/openstack_api/auth.ex b/lib/hubic/openstack_api/auth.ex
index c2dbd3e..52f677d 100644
--- a/lib/hubic/openstack_api/auth.ex
+++ b/lib/hubic/openstack_api/auth.ex
@@ -15,7 +15,7 @@ defmodule ExOvh.Hubic.OpenstackApi.Auth do
:: ExOvh.Client.query_t
def prepare_request(client, query)
- def prepare_request(client, {method, uri, params} = query) when method in [:get, :delete] do
+ def prepare_request(client, {method, uri, params} = query) when method in [:get, :head, :delete] do
uri = Cache.get_endpoint(client) <> uri
if params !== :nil and params !== "", do: uri = uri <> "?" <> URI.encode_query(params)
options = %{ headers: headers(client), timeout: @timeout }
diff --git a/lib/ovh/openstack_api/webstorage/auth.ex b/lib/ovh/openstack_api/webstorage/auth.ex
index 6e432ef..fa2cfa5 100644
--- a/lib/ovh/openstack_api/webstorage/auth.ex
+++ b/lib/ovh/openstack_api/webstorage/auth.ex
@@ -15,7 +15,7 @@ defmodule ExOvh.Ovh.OpenstackApi.Webstorage.Auth do
:: ExOvh.Client.query_t
def prepare_request(client, query)
- def prepare_request(client, {method, uri, params} = query, service) when method in [:get, :delete] do
+ def prepare_request(client, {method, uri, params} = query, service) when method in [:get, :head, :delete] do
uri = WebStorageCache.get_swift_endpoint(client, service) <> uri
if params !== :nil and params !== "", do: uri = uri <> "?" <> URI.encode_query(params)
options = %{ headers: headers(client, service), timeout: @timeout }
diff --git a/lib/ovh/ovh_api/auth.ex b/lib/ovh/ovh_api/auth.ex
index d282e13..f88db27 100644
--- a/lib/ovh/ovh_api/auth.ex
+++ b/lib/ovh/ovh_api/auth.ex
@@ -21,7 +21,7 @@ defmodule ExOvh.Ovh.OvhApi.Auth do
:: ExOvh.Client.query_t
def prepare_request(client, query)
- def prepare_request(client, {method, uri, params} = query) when method in [:get, :delete] do
+ def prepare_request(client, {method, uri, params} = query) when method in [:get, :head, :delete] do
uri = uri(config, uri)
config = config(client)
if params !== :nil and params !== "" and is_map(params), do: uri = uri <> "?" <> URI.encode_query(params)