From 0decfe98b7861ab1d1601b6ad5df674e7fe8c905 Mon Sep 17 00:00:00 2001 From: Mike Morearty Date: Sun, 17 Feb 2013 18:23:32 -0800 Subject: [PATCH] Add header line when writing to cookies.txt When Python is reading a Netscape-format cookies.txt file, it seems to require an initial line that looks like this: # Netscape HTTP Cookie File --- lib/http/cookie_jar.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/http/cookie_jar.rb b/lib/http/cookie_jar.rb index 79f405f..dce37f9 100644 --- a/lib/http/cookie_jar.rb +++ b/lib/http/cookie_jar.rb @@ -163,6 +163,7 @@ class HTTP::CookieJar # Write cookies to Mozilla cookies.txt-style IO stream and return # self. def dump_cookiestxt(io) + io.puts "# Netscape HTTP Cookie File" to_a.each do |cookie| io.print cookie.to_cookiestxt_line end