Semicolons in request parameter in Rails 2.3

32 views
Skip to first unread message

Florian j. Breunig

unread,
Aug 13, 2009, 5:45:24 PM8/13/09
to rubyonra...@googlegroups.com
Hi,

after upgrading Rails from 2.2.2 to 2.3.3 I realized that the handling
of request parameters has been changed regarding semicolons (that might
be due to the now integrated Rack interface). The following request

curl http://127.0.0.1:3000/polls/initiate -d 'hallo=1;2'

used to result in

Parameters: {"hallo"=>"1;2"}

in Rails 2.2.2. However, in Rails 2.3.3, the result is this:

Parameters: {"hallo"=>"1", "2"=>nil}

My application receives ICS (i.e. iCal) plain text containing semicolons
wrapped inside a POST request, so in my case a semicolon is *not* meant
to separate different parameters. How can I restore the previous
behaviour in Rails 2.3?

Thank you
Flow
--
Posted via http://www.ruby-forum.com/.

Matt Jones

unread,
Aug 14, 2009, 2:39:16 PM8/14/09
to Ruby on Rails: Talk
This may be more of a question for a Rack list, as that's what's doing
the parsing. However, I'd note that the only two incoming encodings
that the parameter parser supports are application/x-www-form-
urlencoded (which requires escaped semicolons) and multipart/form-
data. You might have more luck getting ahold of the unparsed POST body
from Rack::Request and handling it yourself.

--Matt Jones

On Aug 13, 5:45 pm, "Florian j. Breunig" <rails-mailing-l...@andreas-
s.net> wrote:
> Hi,
>
> after upgrading Rails from 2.2.2 to 2.3.3 I realized that the handling
> of request parameters has been changed regarding semicolons (that might
> be due to the now integrated Rack interface). The following request
>
> curlhttp://127.0.0.1:3000/polls/initiate-d 'hallo=1;2'

Florian J. Breunig

unread,
Aug 17, 2009, 4:43:48 PM8/17/09
to rubyonra...@googlegroups.com
I see. The encoding of my incoming request is supposed to be
"multipart/form-data", which does not require escaped semicolons. The
incorrect request encoding has never been much of an issue for me until
the recent Rails upgrade.

BTW this implies that the "-d" curl parameter mentioned above must be
replaced by "-F".

Thank you for your help.

Reply all
Reply to author
Forward
0 new messages