req
req copied to clipboard
Bypass URI.encode on params
I have a route that requires test=a,b
but when passed as a param to Req
it converts that into test=a%2Cb
which is wrong.
Current work around is
defp put_param_unencoded(req) do
update_in(req.url.query, fn
nil -> "test=a,b"
query -> query <> "&" <> "test=a,b"
end)
end
Req.new(...)
|> put_param_unencoded()
Thank you for the report. Do you know what the spec says about encoding this character and/or how other popular HTTP clients treat it? In other words, do you have a proposal how this should work in Req?
Actually I think I am being very very stupid. Thanks for sanity checking me.