From: Simon Chiang <simon.a.chiang@gmail.com>
To: Rack Development <rack-devel@googlegroups.com>
Subject: Re: BUG: quote escaping destroys text (with spec patch)
Date: Mon, 7 Jun 2010 07:45:26 -0700 (PDT) [thread overview]
Message-ID: <9d827176-2e00-46e1-b4a2-6a3acda4ff63@s4g2000prh.googlegroups.com> (raw)
In-Reply-To: <c265b2d1-69b6-458b-980a-e0ba7992b131@w12g2000yqj.googlegroups.com>
This has tripped up numerous people. See also:
* http://groups.google.com/group/rack-devel/browse_thread/thread/94b8116ecdef5ec5
* http://groups.google.com/group/rack-devel/browse_thread/thread/befbad49b6409b45
* http://groups.google.com/group/rack-devel/browse_thread/thread/f81f79e633b9e086
* http://github.com/rack/rack/issues#issue/16
A patch that removes quote parsing and fixes the specs (including the
one reported on this thread) is here:
http://github.com/bahuvrihi/rack/commit/ec6edf522d581336a8900e68bde46
On Jun 6, 5:11 am, "Andreas S." <use...@andreas-s.net> wrote:
> SPEC:
>
> diff --git a/test/spec_rack_request.rb b/test/spec_rack_request.rb
> index 43a4b87..cfda3a1 100644
> --- a/test/spec_rack_request.rb
> +++ b/test/spec_rack_request.rb
> @@ -555,4 +555,12 @@ EOF
> req2.params.should.equal "foo" => "#{b}bar#{b}"
> end
> }
> +
> + specify "should not remove text containing quotes" do
> + url = "/?foo=" + CGI.escape("bar\n\"baz\"")
> + env = Rack::MockRequest.env_for(url)
> + req = Rack::Request.new(env)
> + req.GET.should.equal "foo" => "bar\n\"baz\""
> + req.params.should.equal "foo" => "bar\n\"baz\""
> + end
> end
>
> RESULT:
> 3) Failure:
> test_spec {Rack::Request} 129 [should not remove text containing
> quotes](Rack::Request) [./test/spec_rack_request.rb:563]:
> <{"foo"=>"bar\n\"baz\""}> expected but was
> <{"foo"=>"baz"}>.
next prev parent reply other threads:[~2010-06-07 14:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-06 11:11 BUG: quote escaping destroys text (with spec patch) Andreas S.
2010-06-07 14:45 ` Simon Chiang [this message]
2010-06-08 2:02 ` Michael Fellinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://groups.google.com/group/rack-devel
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9d827176-2e00-46e1-b4a2-6a3acda4ff63@s4g2000prh.googlegroups.com \
--to=rack-devel@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).