Skip to content

Commit 843f22e

Browse files
committed
Fix for lastest.
1 parent c190797 commit 843f22e

File tree

3 files changed

+2
-29
lines changed

3 files changed

+2
-29
lines changed

cookie.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import (
1111
"io"
1212
"os"
1313
"sort"
14-
"strconv"
1514
"strings"
1615
"time"
1716
)
@@ -30,9 +29,6 @@ func writeSetCookies(w io.Writer, kk []*http.Cookie) os.Error {
3029
b.Reset()
3130
// TODO(petar): c.Value (below) should be unquoted if it is recognized as quoted
3231
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-
}
3632
if len(c.Path) > 0 {
3733
fmt.Fprintf(&b, "; Path=%s", http.URLEscape(c.Path))
3834
}
@@ -51,9 +47,6 @@ func writeSetCookies(w io.Writer, kk []*http.Cookie) os.Error {
5147
if c.Secure {
5248
fmt.Fprintf(&b, "; Secure")
5349
}
54-
if len(c.Comment) > 0 {
55-
fmt.Fprintf(&b, "; Comment=%s", http.URLEscape(c.Comment))
56-
}
5750
lines = append(lines, "Set-Cookie: "+b.String()+"\r\n")
5851
}
5952
sort.SortStrings(lines)
@@ -75,9 +68,6 @@ func writeCookies(w io.Writer, kk []*http.Cookie) os.Error {
7568
for _, c := range kk {
7669
b.Reset()
7770
n := c.Name
78-
if c.Version > 0 {
79-
fmt.Fprintf(&b, "$Version=%d; ", c.Version)
80-
}
8171
// TODO(petar): c.Value (below) should be unquoted if it is recognized as quoted
8272
fmt.Fprintf(&b, "%s=%s", http.CanonicalHeaderKey(n), c.Value)
8373
if len(c.Path) > 0 {
@@ -89,9 +79,6 @@ func writeCookies(w io.Writer, kk []*http.Cookie) os.Error {
8979
if c.HttpOnly {
9080
fmt.Fprintf(&b, "; $HttpOnly")
9181
}
92-
if len(c.Comment) > 0 {
93-
fmt.Fprintf(&b, "; $Comment=%s", http.URLEscape(c.Comment))
94-
}
9582
lines = append(lines, "Cookie: "+b.String()+"\r\n")
9683
}
9784
sort.SortStrings(lines)
@@ -120,10 +107,8 @@ func readCookies(h http.Header) []*http.Cookie {
120107
}
121108
// Per-line attributes
122109
var lineCookies = make(map[string]string)
123-
var version int
124110
var path string
125111
var domain string
126-
var comment string
127112
var httponly bool
128113
for i := 0; i < len(parts); i++ {
129114
parts[i] = strings.TrimSpace(parts[i])
@@ -142,20 +127,12 @@ func readCookies(h http.Header) []*http.Cookie {
142127
switch strings.ToLower(attr) {
143128
case "$httponly":
144129
httponly = true
145-
case "$version":
146-
version, err = strconv.Atoi(val)
147-
if err != nil {
148-
version = 0
149-
continue
150-
}
151130
case "$domain":
152131
domain = val
153132
// TODO: Add domain parsing
154133
case "$path":
155134
path = val
156135
// TODO: Add path parsing
157-
case "$comment":
158-
comment = val
159136
default:
160137
lineCookies[attr] = val
161138
}
@@ -169,8 +146,6 @@ func readCookies(h http.Header) []*http.Cookie {
169146
Value: v,
170147
Path: path,
171148
Domain: domain,
172-
Comment: comment,
173-
Version: version,
174149
HttpOnly: httponly,
175150
MaxAge: -1,
176151
Raw: line,

request.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func flattenParams(fullParams map[string][]string) map[string]string {
6464

6565
func newRequest(hr *http.Request, hc http.ResponseWriter) *Request {
6666

67-
remoteAddr, _ := net.ResolveTCPAddr(hc.RemoteAddr())
67+
remoteAddr, _ := net.ResolveTCPAddr(hr.RemoteAddr)
6868

6969
req := Request{
7070
Method: hr.Method,

web.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,7 @@ type httpConn struct {
213213
func (c *httpConn) StartResponse(status int) { c.conn.WriteHeader(status) }
214214

215215
func (c *httpConn) SetHeader(hdr string, val string, unique bool) {
216-
//right now unique can't be implemented through the http package.
217-
//see issue 488
218-
c.conn.SetHeader(hdr, val)
216+
c.conn.Header().Set(hdr, val)
219217
}
220218

221219
func (c *httpConn) WriteString(content string) {

0 commit comments

Comments
 (0)