diff --git a/lib/aws/generated/s3.ex b/lib/aws/generated/s3.ex index b3324eb2..a0c9f7b5 100644 --- a/lib/aws/generated/s3.ex +++ b/lib/aws/generated/s3.ex @@ -4787,6 +4787,12 @@ defmodule AWS.S3 do ] |> Request.build_params(input) + {custom_headers, input} = + [ + {"Metadata", "x-amz-meta-"} + ] + |> Request.build_params(input) + query_params = [] options = @@ -4809,7 +4815,7 @@ defmodule AWS.S3 do meta = metadata() - Request.request_rest(client, meta, :put, url_path, query_params, headers, input, options, 200) + Request.request_rest(client, meta, :put, url_path, query_params, custom_headers ++ headers, input, options, 200) end @doc """ @@ -5324,6 +5330,12 @@ defmodule AWS.S3 do ] |> Request.build_params(input) + {custom_headers, input} = + [ + {"Metadata", "x-amz-meta-"} + ] + |> Request.build_params(input) + query_params = [] options = @@ -5352,7 +5364,7 @@ defmodule AWS.S3 do :post, url_path, query_params, - headers, + custom_headers ++ headers, input, options, 200 @@ -13299,6 +13311,12 @@ defmodule AWS.S3 do ] |> Request.build_params(input) + {custom_headers, input} = + [ + {"Metadata", "x-amz-meta-"} + ] + |> Request.build_params(input) + query_params = [] options = @@ -13332,7 +13350,7 @@ defmodule AWS.S3 do meta = metadata() - Request.request_rest(client, meta, :put, url_path, query_params, headers, input, options, 200) + Request.request_rest(client, meta, :put, url_path, query_params, custom_headers ++ headers, input, options, 200) end @doc """ @@ -14966,6 +14984,12 @@ defmodule AWS.S3 do ] |> Request.build_params(input) + {custom_headers, input} = + [ + {"Metadata", "x-amz-meta-"} + ] + |> Request.build_params(input) + query_params = [] options = @@ -14983,7 +15007,7 @@ defmodule AWS.S3 do :post, url_path, query_params, - headers, + custom_headers ++ headers, input, options, 200 diff --git a/lib/aws/request.ex b/lib/aws/request.ex index fa898c6b..b143b4e5 100644 --- a/lib/aws/request.ex +++ b/lib/aws/request.ex @@ -324,6 +324,15 @@ defmodule AWS.Request do nil -> {headers, params} + param_value when is_map(param_value) -> + headers = + Enum.reduce(param_value, headers, fn {k, v}, headers -> + [{header_name <> k, v}] ++ headers + end) + + params = Map.delete(params, param_name) + {headers, params} + param_value -> headers = [{header_name, param_value} | headers] params = Map.delete(params, param_name)