@@ -11,7 +11,6 @@ import (
11
11
"io"
12
12
"os"
13
13
"sort"
14
- "strconv"
15
14
"strings"
16
15
"time"
17
16
)
@@ -30,9 +29,6 @@ func writeSetCookies(w io.Writer, kk []*http.Cookie) os.Error {
30
29
b .Reset ()
31
30
// TODO(petar): c.Value (below) should be unquoted if it is recognized as quoted
32
31
fmt .Fprintf (& b , "%s=%s" , http .CanonicalHeaderKey (c .Name ), c .Value )
33
- if c .Version > 0 {
34
- fmt .Fprintf (& b , "Version=%d; " , c .Version )
35
- }
36
32
if len (c .Path ) > 0 {
37
33
fmt .Fprintf (& b , "; Path=%s" , http .URLEscape (c .Path ))
38
34
}
@@ -51,9 +47,6 @@ func writeSetCookies(w io.Writer, kk []*http.Cookie) os.Error {
51
47
if c .Secure {
52
48
fmt .Fprintf (& b , "; Secure" )
53
49
}
54
- if len (c .Comment ) > 0 {
55
- fmt .Fprintf (& b , "; Comment=%s" , http .URLEscape (c .Comment ))
56
- }
57
50
lines = append (lines , "Set-Cookie: " + b .String ()+ "\r \n " )
58
51
}
59
52
sort .SortStrings (lines )
@@ -75,9 +68,6 @@ func writeCookies(w io.Writer, kk []*http.Cookie) os.Error {
75
68
for _ , c := range kk {
76
69
b .Reset ()
77
70
n := c .Name
78
- if c .Version > 0 {
79
- fmt .Fprintf (& b , "$Version=%d; " , c .Version )
80
- }
81
71
// TODO(petar): c.Value (below) should be unquoted if it is recognized as quoted
82
72
fmt .Fprintf (& b , "%s=%s" , http .CanonicalHeaderKey (n ), c .Value )
83
73
if len (c .Path ) > 0 {
@@ -89,9 +79,6 @@ func writeCookies(w io.Writer, kk []*http.Cookie) os.Error {
89
79
if c .HttpOnly {
90
80
fmt .Fprintf (& b , "; $HttpOnly" )
91
81
}
92
- if len (c .Comment ) > 0 {
93
- fmt .Fprintf (& b , "; $Comment=%s" , http .URLEscape (c .Comment ))
94
- }
95
82
lines = append (lines , "Cookie: " + b .String ()+ "\r \n " )
96
83
}
97
84
sort .SortStrings (lines )
@@ -120,10 +107,8 @@ func readCookies(h http.Header) []*http.Cookie {
120
107
}
121
108
// Per-line attributes
122
109
var lineCookies = make (map [string ]string )
123
- var version int
124
110
var path string
125
111
var domain string
126
- var comment string
127
112
var httponly bool
128
113
for i := 0 ; i < len (parts ); i ++ {
129
114
parts [i ] = strings .TrimSpace (parts [i ])
@@ -142,20 +127,12 @@ func readCookies(h http.Header) []*http.Cookie {
142
127
switch strings .ToLower (attr ) {
143
128
case "$httponly" :
144
129
httponly = true
145
- case "$version" :
146
- version , err = strconv .Atoi (val )
147
- if err != nil {
148
- version = 0
149
- continue
150
- }
151
130
case "$domain" :
152
131
domain = val
153
132
// TODO: Add domain parsing
154
133
case "$path" :
155
134
path = val
156
135
// TODO: Add path parsing
157
- case "$comment" :
158
- comment = val
159
136
default :
160
137
lineCookies [attr ] = val
161
138
}
@@ -169,8 +146,6 @@ func readCookies(h http.Header) []*http.Cookie {
169
146
Value : v ,
170
147
Path : path ,
171
148
Domain : domain ,
172
- Comment : comment ,
173
- Version : version ,
174
149
HttpOnly : httponly ,
175
150
MaxAge : - 1 ,
176
151
Raw : line ,
0 commit comments