rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: Michael Fellinger <m.fellinger@gmail.com>
To: rack-devel@googlegroups.com
Subject: Re: BUG: quote escaping destroys text (with spec patch)
Date: Tue, 8 Jun 2010 11:02:48 +0900	[thread overview]
Message-ID: <AANLkTiljzHE5uZ5XeXkXSDMcJgq60JXr2uHM2Yw1HT9c@mail.gmail.com> (raw)
In-Reply-To: <9d827176-2e00-46e1-b4a2-6a3acda4ff63@s4g2000prh.googlegroups.com>

OK, I applied the patch from bahuvrihi, will update the bug trackers.

On Mon, Jun 7, 2010 at 11:45 PM, Simon Chiang <simon.a.chiang@gmail.com> wrote:
> 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"}>.



-- 
Michael Fellinger
CTO, The Rubyists, LLC

      reply	other threads:[~2010-06-08  2:03 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
2010-06-08  2:02   ` Michael Fellinger [this message]

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=AANLkTiljzHE5uZ5XeXkXSDMcJgq60JXr2uHM2Yw1HT9c@mail.gmail.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).