anchor.diff:          error ->
               ?EMPTY_HASH
       end,
  -    Headers1 = maps:get(headers, Config, #{}),
  -    Headers2 = Headers1#{
  -        <<"x-amz-date">> => Date,
  -        <<"x-amz-content-sha256">> => HexHash,
  -        <<"host">> => Host
  -    },
  +    Headers1 = maps:get(headers, Config, []),
  +    Headers2 = [
  +        {<<"x-amz-date">>, Date},
  +        {<<"x-amz-content-sha256">>, HexHash},
  +        {<<"host">>, Host}
  +        | Headers1
  +    ],
       Headers3 = case maps:find(meta, Config) of
           {ok, Meta} ->
               lists:foldl(
                   fun({Key, Val}, Acc) ->
                       HeaderKey = <<"x-amz-meta-", (nklib_util:to_lower(Key))/binary>>,
  -                    Acc#{HeaderKey => to_bin(Val)}
  +                    [{HeaderKey, to_bin(Val)} | Acc]
                   end,
                   Headers2,
                   maps:to_list(Meta));
  
positive.code:     key => string()|binary(),
      secret => string()|binary(),
      path => string() | binary(),            %% Uri-encoded (except for S3)
      headers => #{string()|binary()|atom() => string()|binary()},
      params => #{string()|binary()|atom() => string()|binary()},
      meta => #{string()|binary()|atom() => string()|binary()},
      hash => binary,                         %% crypto:hash(sha256, Body)
  
negative.code:         "&Signature=", url_encode(Enc),
          "&Expires=", Expires
      ]),
      {_Region, _Service, _Host, Url} = get_service(Config),
      {Method, <<Url/binary, Path/binary, Qs/binary>>}.
  
  
  
  %% ===================================================================
  %% Internal
  %% ===================================================================
  
  get_service(Config) ->
      Region = to_bin(maps:get(region, Config, ?DEFAULT_REGION)),
      Service = to_bin(maps:get(service, Config, s3)),
      Scheme = to_bin(maps:get(scheme, Config, <<"https">>)),
      DefPort = case Scheme of <<"http">> -> 80; <<"https">> -> 443 end,
      Port = to_bin(maps:get(port, Config, DefPort)),
      Host = case maps:find(host, Config) of
          {ok, ConfigHost} ->
              to_bin(ConfigHost);
          error ->
              <<Service/binary, $., Region/binary, ".amazonaws.com">>
      end,
      FullHost = <<Host/binary, $:, Port/binary>>,
      Url = <<Scheme/binary, "://", FullHost/binary>>,
      {Region, Service, FullHost, Url}.
  
  
  %% @private
  