Skip to content

Commit

Permalink
Merge pull request #82 from Vagabond/adt/true-in-args_urldecode
Browse files Browse the repository at this point in the history
Handle arguments with no value in (post|get)_arg_decoded
  • Loading branch information
tsloughter authored Mar 24, 2020
2 parents 1f0d65e + 002d563 commit 21e2eeb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/elli_request.erl
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ get_arg_decoded(Key, #req{} = Req) ->
get_arg_decoded(Key, #req{args = Args}, Default) ->
case proplists:get_value(Key, Args) of
undefined -> Default;
true -> true;
EncodedValue ->
uri_decode(EncodedValue)
end.
Expand Down Expand Up @@ -127,6 +128,7 @@ post_arg_decoded(Key, #req{} = Req) ->
post_arg_decoded(Key, #req{} = Req, Default) ->
case proplists:get_value(Key, body_qs(Req)) of
undefined -> Default;
true -> true;
EncodedValue ->
uri_decode(EncodedValue)
end.
Expand Down

0 comments on commit 21e2eeb

Please sign in to comment.