| summaryrefslogtreecommitdiff | 
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-01-28 23:31:29 +0100 | 
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2019-01-28 23:31:29 +0100 | 
| commit | c116cb57903333bec870d50df180fbcb624f21ff (patch) | |
| tree | 5153b61f3ce12ec15cf3656c95520d5523f5323d /src/shared | |
| parent | dc988b5aa72204954b2034615d644c703b35d294 (diff) | |
...
Diffstat (limited to 'src/shared')
| -rw-r--r-- | src/shared/struct/shr_query.erl | 24 | 
1 files changed, 20 insertions, 4 deletions
| diff --git a/src/shared/struct/shr_query.erl b/src/shared/struct/shr_query.erl index 44d3222..e85f204 100644 --- a/src/shared/struct/shr_query.erl +++ b/src/shared/struct/shr_query.erl @@ -10,7 +10,8 @@     query,     {        ip :: binary(), -      params :: map:map(binary(), any()) +      params :: map(), +      url_params :: dict:dict(binary(), any())     }  ). @@ -26,7 +27,8 @@     [        new/1,        get_ip/1, -      get_params/1 +      get_params/1, +      get_url_params/1     ]  ). @@ -45,11 +47,25 @@ new (YawsArg) ->     #query     {        ip = IP, -      params = jiffy:decode(YawsArg#arg.clidata, [return_maps]) +      params = jiffy:decode(YawsArg#arg.clidata, [return_maps]), +      url_params = +         dict:from_list +         ( +            lists:map +            ( +               fun ({K, V}) -> +                  {list_to_binary(K), list_to_binary(V)} +               end, +               yaws_api:parse_query(YawsArg) +            ) +         )     }.  -spec get_ip (type()) -> binary().  get_ip (Query) -> Query#query.ip. --spec get_params (type()) -> map:map(binary(), any()). +-spec get_params (type()) -> map().  get_params (Query) -> Query#query.params. + +-spec get_url_params (type()) -> dict:dict(binary(), any()). +get_url_params (Query) -> Query#query.url_params. | 


