@@ -175,6 +175,7 @@ describe("http patterns", function()
175175 it (" Parses a Set-Cookie header" , function ()
176176 local Set_Cookie = lpeg .Ct (http .Set_Cookie ) * EOF
177177 assert .same ({" SID" , " 31d4d96e407aad42" , {}}, Set_Cookie :match " SID=31d4d96e407aad42" )
178+ assert .same ({" SID" , " " , {}}, Set_Cookie :match " SID=" )
178179 assert .same ({" SID" , " 31d4d96e407aad42" , {path = " /" ; domain = " example.com" }}, Set_Cookie :match " SID=31d4d96e407aad42; Path=/; Domain=example.com" )
179180 assert .same ({" SID" , " 31d4d96e407aad42" , {
180181 path = " /" ;
@@ -187,15 +188,16 @@ describe("http patterns", function()
187188 -- Quoted cookie value
188189 assert .same ({" SID" , " 31d4d96e407aad42" , {path = " /" ;}}, Set_Cookie :match [[ SID="31d4d96e407aad42"; Path=/]] )
189190 -- Crazy whitespace
190- assert .same ({" SID" , " 31d4d96e407aad42" , {path = " /" ;}}, Set_Cookie :match " SID = 31d4d96e407aad42 ; Path = / " )
191- assert .same ({" SID" , " 31d4d96e407aad42" , {[" foo bar" ] = true ;}}, Set_Cookie :match " SID = 31d4d96e407aad42 ; foo bar " )
191+ assert .same ({" SID" , " 31d4d96e407aad42" , {path = " /" ;}}, Set_Cookie :match " SID = 31d4d96e407aad42 ; Path = /" )
192+ assert .same ({" SID" , " 31d4d96e407aad42" , {[" foo bar" ] = true ;}}, Set_Cookie :match " SID = 31d4d96e407aad42 ; foo bar" )
192193 end )
193194 it (" Parses a Cookie header" , function ()
194195 local Cookie = http .Cookie * EOF
195196 assert .same ({SID = " 31d4d96e407aad42" }, Cookie :match " SID=31d4d96e407aad42" )
197+ assert .same ({SID = " 31d4d96e407aad42" }, Cookie :match " SID = 31d4d96e407aad42" )
196198 assert .same ({SID = " 31d4d96e407aad42" , lang = " en-US" }, Cookie :match " SID=31d4d96e407aad42; lang=en-US" )
197199 end )
198- it (" Parses a Content_Disposition header" , function ()
200+ it (" Parses a Content-Disposition header" , function ()
199201 local Content_Disposition = lpeg .Ct (http .Content_Disposition ) * EOF
200202 assert .same ({" foo" , {}}, Content_Disposition :match " foo" )
201203 assert .same ({" foo" , {filename = " example" }}, Content_Disposition :match " foo; filename=example" )
0 commit comments