Skip to content

Commit

Permalink
fix #60. big bug: MATCH_ANY would ignore any surrounding required pat…
Browse files Browse the repository at this point in the history
…terns
  • Loading branch information
andreineculau committed Jan 19, 2018
1 parent 2bae5fe commit 4b3ed5a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/example-httpbin.apib
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,5 @@ GET /get?whoarewe={{<whoarewe}}&origin={{<origin}}&somevalue={{<some_static_para
},
"headers": "{{_}}",
"origin": "{{_}}",
"url": "{{<protocol}}//{{<hostname}}/get?origin={{<origin}}{{_}}"
"url": "{{<protocol}}//{{<hostname}}/get?{{_}}&origin={{<origin}}&{{_}}"
}
4 changes: 1 addition & 3 deletions src/katt_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -521,9 +521,7 @@ validate_primitive(Key, E, A, Callbacks) when is_list(E) ->
case re:run(E, RE_HAS_PARAMS, [global, {capture, all_but_first, list}]) of
nomatch when is_list(A) ->
{not_equal, {Key, E, A, TextDiffFun(E, A)}};
{match, [[?MATCH_ANY]]} ->
{pass, []};
{match, [[E]]} ->
{match, [[E]]} when E =/= ?MATCH_ANY ->
{pass, [{store_tag2param(E), A}]};
{match, Params0} when is_list(A) ->
Params = lists:map( fun([?MATCH_ANY]) ->
Expand Down

0 comments on commit 4b3ed5a

Please sign in to comment.