summary refs log tree commit
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-12-18 04:20:13 +0800
committerJoshua Peek <josh@joshpeek.com>2010-12-20 04:00:53 +0800
commit59bd279ab832cda3a6cc43bfd9590c3008c58285 (patch)
tree12d590badd46e5f4f23bc9efeae7ab8f23c7a4eb
parent5ddd115c8156975281b6961237a0fc94a104659d (diff)
downloadrack-59bd279ab832cda3a6cc43bfd9590c3008c58285.tar.gz
parsing cookies with quotes works
-rw-r--r--test/spec_request.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/spec_request.rb b/test/spec_request.rb
index f240be40..9f77f131 100644
--- a/test/spec_request.rb
+++ b/test/spec_request.rb
@@ -330,6 +330,18 @@ describe Rack::Request do
     req.cookies.should.equal 'foo' => 'bar'
   end
 
+  should 'parse cookies with quotes' do
+    req = Rack::Request.new Rack::MockRequest.env_for('', {
+      'HTTP_COOKIE' => '$Version="1"; Customer="WILE_E_COYOTE"; $Path="/acme"; Part_Number="Rocket_Launcher_0001"; $Path="/acme"'
+    })
+    req.cookies.should.equal({
+      '$Version'    => '"1"',
+      'Customer'    => '"WILE_E_COYOTE"',
+      '$Path'       => '"/acme"',
+      'Part_Number' => '"Rocket_Launcher_0001"',
+    })
+  end
+
   should "provide setters" do
     req = Rack::Request.new(e=Rack::MockRequest.env_for(""))
     req.script_name.should.equal ""