Closed Skoda091 closed 2 years ago
According to the spec, foo
is the same as foo=
but that’s not how it worked before. So this was a bug fix applied to both Elixir and Plug.
Ok, so this is expected behavior?
But when I run this on latest elixir 1.13.3-otp-24
, it gives different results.
iex(1)> URI.decode("files%5B%5D")
"files[]"
iex(2)> URI.decode("foo")
"foo"
iex(3)> URI.decode("foo=")
"foo=
decode
is for URI segments. You want to compare it with decode_query
instead:
iex(7)> URI.decode_query "foo="
%{"foo" => ""}
Closing this per the above.
After bumping plug from
1.10.4
to1.13
, it started to parse the request body differently.Change in parsing between
plug 1.10.4
andplug 1.13
plug
1.10.4
files%5B%5D
parsed to%{"files" => []}
plug
1.13
files%5B%5D
parsed to%{"files" => [""]}
From what I see, the correct option is with an empty array based on the result of
URI
module.I've written a simple test to reproduce the problem.