Skip to content

Commit

Permalink
Zombie now sends V0 cookies (Assaf Arkin).
Browse files Browse the repository at this point in the history
  • Loading branch information
assaf committed Jan 26, 2011
1 parent 2f636db commit ac8f5cc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Expand Up @@ -19,7 +19,11 @@ Ensure fields are sent in the order they are described (José Valim).


Fix parsing of empty body (Vinicius Baggio). Fix parsing of empty body (Vinicius Baggio).


277 Tests Add support for window.screen (Damian Janowski).

Zombie now sends V0 cookies (Assaf Arkin).

278 Tests
4.0 sec to complete 4.0 sec to complete




Expand Down
2 changes: 1 addition & 1 deletion spec/cookie-spec.coffee
Expand Up @@ -132,6 +132,6 @@ vows.describe("Cookies").addBatch(
browser.cookies("localhost").update("foo=bar;") browser.cookies("localhost").update("foo=bar;")
browser.cookies("localhost").addHeader header browser.cookies("localhost").addHeader header
header header
"should set the header according to the spec": (header)-> assert.equal header.cookie, "$Version=1; foo=bar;$Path=/" "should send V0 header": (header)-> assert.equal header.cookie, "foo=bar"


).export(module) ).export(module)
4 changes: 2 additions & 2 deletions src/zombie/cookies.coffee
Expand Up @@ -132,9 +132,9 @@ class Cookies
# #
# Adds Cookie header suitable for sending to the server. # Adds Cookie header suitable for sending to the server.
this.addHeader = (headers)-> this.addHeader = (headers)->
header = ("#{match[2]}=#{match[3].value};$Path=#{match[1]}" for match in selected()).join("; ") header = ("#{match[2]}=#{match[3].value}" for match in selected()).join("; ")
if header.length > 0 if header.length > 0
headers.cookie = "$Version=1; #{header}" headers.cookie = header


#### cookies(host, path).pairs => String #### cookies(host, path).pairs => String
# #
Expand Down

0 comments on commit ac8f5cc

Please sign in to comment.