Skip to content

Commit

Permalink
Merge pull request #516 from sborrazas/qs_opts_type
Browse files Browse the repository at this point in the history
Fix invalid type for hackney_ur:qs/2 options
  • Loading branch information
benoitc committed Sep 1, 2018
2 parents cd8f916 + e996fb8 commit c6e4ad0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/hackney_url.erl
Expand Up @@ -26,6 +26,7 @@
-include("hackney_lib.hrl").

-type qs_vals() :: [{binary(), binary() | true}].
-type qs_opt() :: noplus | upper.

%% @doc Parse an url and return a #hackney_url record.
-spec parse_url(URL::binary()|list()) -> hackney_url().
Expand Down Expand Up @@ -288,7 +289,7 @@ urlencode(Bin) ->
%% characters, `\s', as `+'. The `upper' option overrides the default behaviour
%% of writing hex numbers using lowecase letters to using uppercase letters
%% instead.
-spec urlencode(binary() | string(), [noplus|upper]) -> binary().
-spec urlencode(binary() | string(), [qs_opt()]) -> binary().
urlencode(Bin, Opts) ->
Plus = not proplists:get_value(noplus, Opts, false),
Upper = proplists:get_value(upper, Opts, false),
Expand Down Expand Up @@ -344,7 +345,7 @@ qs(KVs) ->

%% @doc encode query properties to binary
%% Opts are passed to urlencode.
-spec qs(qs_vals(), [atom]) -> binary().
-spec qs(qs_vals(), [qs_opt()]) -> binary().
qs(KVs, Opts) ->
qs(KVs, Opts, []).

Expand Down

0 comments on commit c6e4ad0

Please sign in to comment.