Skip to content

Instantly share code, notes, and snippets.

@ujh
Created August 17, 2009 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ujh/169106 to your computer and use it in GitHub Desktop.
Save ujh/169106 to your computer and use it in GitHub Desktop.
From dabd97ec82099de266180372fe63b3c9b426f16e Mon Sep 17 00:00:00 2001
From: Urban Hafner <uh@msales.com>
Date: Mon, 17 Aug 2009 14:54:21 +0200
Subject: [PATCH] Remove empty lines that are produced by splitting the cookie string
---
lib/rack/test/cookie_jar.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/rack/test/cookie_jar.rb b/lib/rack/test/cookie_jar.rb
index d2f3d2b..be3ffd2 100644
--- a/lib/rack/test/cookie_jar.rb
+++ b/lib/rack/test/cookie_jar.rb
@@ -116,7 +116,7 @@ module Rack
def merge(raw_cookies, uri = nil)
return unless raw_cookies
- Array(raw_cookies).join("\n").split("\n").each do |raw_cookie|
+ Array(raw_cookies).join("\n").split("\n").reject {|c| c =~ /^\s*$/}.each do |raw_cookie|
cookie = Cookie.new(raw_cookie, uri, @default_host)
self << cookie if cookie.valid?(uri)
end
--
1.6.3.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment