Double quotes are not preserved confirmation

6 views
Skip to first unread message

Neeraj Singh

unread,
May 14, 2010, 11:58:20 AM5/14/10
to Rack Development
I am working on this rails ticket https://rails.lighthouseapp.com/projects/8994/tickets/4576
.

Then I found this test case http://github.com/rack/rack/blob/master/test/spec_rack_utils.rb#L35
. As you can see if the data has double quotes then double quotes are
being removed.

However if the data has a new line character then double quotes are
preserved.

Questions:

1) I looked at the rack spec but could not find any mention of this
behavior that double quotes should be removed only if string does not
contain a new line character.

2) If the existing behavior is the correct behavior then could you
please add this test case which makes it explicitly clear that string
with new line character will have double quotes preserver. Here is my
commit.

http://github.com/neerajdotname/rack/commit/1454a2171032e2260dc7199f1077aad08fc4b59a

Needless to say that test is passing with that commit.


Thanks

- Neeraj

Simon Chiang

unread,
May 14, 2010, 7:32:50 PM5/14/10
to Rack Development
Hi this issue has come up several times now.

* http://groups.google.com/group/rack-devel/browse_thread/thread/befbad49b6409b45
* http://groups.google.com/group/rack-devel/browse_thread/thread/f81f79e633b9e086

I think it is a bug. I found the commit that introduced this
behavior. Looks like it was intentional but perhaps just a bad
choice? http://github.com/bahuvrihi/rack/commit/fb4f2b5fe26a0e3821ac0f6361a3885bd88b42ca

A patch that removes quote parsing and fixes the specs is here:
http://github.com/bahuvrihi/rack/commit/ec6edf522d581336a8900e68bde46848e90e21ba



On May 14, 9:58 am, Neeraj Singh <neerajdotn...@gmail.com> wrote:
> I am working on this rails tickethttps://rails.lighthouseapp.com/projects/8994/tickets/4576
> .
>
> Then I found this test casehttp://github.com/rack/rack/blob/master/test/spec_rack_utils.rb#L35
> . As you can see if the data has double quotes then double quotes are
> being removed.
>
> However if the data has a new line character then double quotes are
> preserved.
>
> Questions:
>
> 1) I looked at the rack spec but could not find any mention of this
> behavior that double quotes should be removed only if string does not
> contain a new line character.
>
> 2) If the existing behavior is the correct behavior then could you
> please add this test case which makes it explicitly clear that string
> with new line character will have double quotes preserver.  Here is my
> commit.
>
> http://github.com/neerajdotname/rack/commit/1454a2171032e2260dc7199f1...

Neeraj Singh

unread,
May 14, 2010, 9:25:53 PM5/14/10
to Rack Development
@Simon Thanks for the update.

I should have looked into the archive before asking the question.
Sorry about that.

Well it is an issue confirmed by some and there is already a patch.
Looks like someone has to pull the trigger and apply the patch.



On May 14, 7:32 pm, Simon Chiang <simon.a.chi...@gmail.com> wrote:
> Hi this issue has come up several times now.
>
> *http://groups.google.com/group/rack-devel/browse_thread/thread/befbad...
> *http://groups.google.com/group/rack-devel/browse_thread/thread/f81f79...
>
> I think it is a bug.  I found the commit that introduced this
> behavior.  Looks like it was intentional but perhaps just a bad
> choice?  http://github.com/bahuvrihi/rack/commit/fb4f2b5fe26a0e3821ac0f6361a38...
>
> A patch that removes quote parsing and fixes the specs is here:http://github.com/bahuvrihi/rack/commit/ec6edf522d581336a8900e68bde46...

Andreas S.

unread,
Jun 6, 2010, 7:16:56 AM6/6/10
to Rack Development
OK, so apparently this has been known for months, reported several
times, and a patch is available; would PLEASE someone put this in and
make a release?

Filip Tepper

unread,
Jun 11, 2010, 7:21:01 AM6/11/10
to Rack Development
+1 for the release, please!

--
Filip Tepper

Michael Fellinger

unread,
Jun 11, 2010, 10:44:56 PM6/11/10
to rack-...@googlegroups.com

We'll try to get a release out this weekend.

--
Michael Fellinger
CTO, The Rubyists, LLC

Jeremy Hinegardner

unread,
Jun 30, 2010, 7:34:28 PM6/30/10
to rack-...@googlegroups.com
On Sat, Jun 12, 2010 at 11:44:56AM +0900, Michael Fellinger wrote:
> On Fri, Jun 11, 2010 at 8:21 PM, Filip Tepper <fi...@tepper.pl> wrote:
> > On Jun 6, 1:16??pm, "Andreas S." <use...@andreas-s.net> wrote:
> >
> >> OK, so apparently this has been known for months, reported several
> >> times, and a patch is available; would PLEASE someone put this in and
> >> make a release?
> >
> > +1 for the release, please!
>
> We'll try to get a release out this weekend.

In this vein, can this commit(dae12e08) be cherry-picked to the rack-1.1
branch and a rack-1.1.1 release be made? The primary reason is that rails
v2.3.8 has a "rack ~> 1.1.0" dependency. Since this commit is applied in
the rack 1.2 branch, it will not be installed on a rails 2.3.8 installation.

enjoy,

-jeremy

--
========================================================================
Jeremy Hinegardner jer...@hinegardner.org

Reply all
Reply to author
Forward
0 new messages