Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix invalid type for hackney_ur:qs/2 options #516

Merged
merged 1 commit into from Sep 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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