@@ -116,6 +116,22 @@ def get_cookies_test_one_set_cookie_header
116
116
HEREDOC
117
117
end
118
118
119
+ def get_cookies_comma_separated
120
+ <<-HEREDOC . gsub ( /^ {6}/ , '' )
121
+ HTTP/1.1 200 OK
122
+ Expires: Thu, 26 Oct 1978 00:00:00 GMT
123
+ Content-Length: 8556
124
+ Server: CherryPy/3.1.2
125
+ Date: Sun, 06 Jul 2014 20:09:28 GMT
126
+ Cache-Control: no-store, max-age=0, no-cache, must-revalidate
127
+ Content-Type: text/html;charset=utf-8
128
+ Set-Cookie: cval=880350187, session_id_8000=83466b1a1a7a27ce13d35f78155d40ca3a1e7a28; expires=Mon, 07 Jul 2014 20:09:28 GMT; httponly; Path=/, uid=348637C4-9B10-485A-BFA9-5E892432FCFD; expires=Fri, 05-Jul-2019 20:09:28 GMT
129
+
130
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
131
+ <!--[if lt IE 7]> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://www.splunk.com/xhtml-extensions/1.0" xml:lang="en" lang="en" class="no-js lt-ie9 lt-ie8 lt-
132
+ HEREDOC
133
+ end
134
+
119
135
def cookie_sanity_check ( meth )
120
136
resp = described_class . new ( )
121
137
resp . parse ( self . send meth )
@@ -185,6 +201,18 @@ def cookie_sanity_check(meth)
185
201
cookies_array . should include ( *expected_cookies )
186
202
end
187
203
204
+ it 'parses comma separated cookies' do
205
+ cookies_array = cookie_sanity_check ( :get_cookies_comma_separated )
206
+ cookies_array . count . should eq ( 3 )
207
+ expected_cookies = %w{
208
+ cval=880350187
209
+ session_id_8000=83466b1a1a7a27ce13d35f78155d40ca3a1e7a28
210
+ uid=348637C4-9B10-485A-BFA9-5E892432FCFD
211
+ }
212
+ expected_cookies . shuffle!
213
+ cookies_array . should include ( *expected_cookies )
214
+ end
215
+
188
216
end
189
217
190
218
end
0 commit comments