Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1216)

Side by Side Diff: src/pkg/net/http/jar.go

Issue 6653049: code review 6653049: net/http/client.go: fix cookie handling on (*Client) Do()
Patch Set: diff -r bb4ee132b967 https://code.google.com/p/go Created 11 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« src/pkg/net/http/client.go ('K') | « src/pkg/net/http/client_test.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package http 5 package http
6 6
7 import ( 7 import (
8 "net/url" 8 "net/url"
9 ) 9 )
10 10
11 // A CookieJar manages storage and use of cookies in HTTP requests. 11 // A CookieJar manages storage and use of cookies in HTTP requests.
12 // 12 //
13 // Implementations of CookieJar must be safe for concurrent use by multiple 13 // Implementations of CookieJar must be safe for concurrent use by multiple
14 // goroutines. 14 // goroutines.
15 type CookieJar interface { 15 type CookieJar interface {
16 » // SetCookies handles the receipt of the cookies in a reply for the 16 » // SetCookies handles the receipt of the cookies in a reply for the
17 » // given URL. It may or may not choose to save the cookies, depending 17 » // given URL. It may or may not choose to save the cookies, depending
18 » // on the jar's policy and implementation. 18 » // on the jar's policy and implementation.
19 SetCookies(u *url.URL, cookies []*Cookie) 19 SetCookies(u *url.URL, cookies []*Cookie)
20 20
21 // Cookies returns the cookies to send in a request for the given URL. 21 // Cookies returns the cookies to send in a request for the given URL.
22 » // It is up to the implementation to honor the standard cookie use 22 » // It is up to the implementation to honor the standard cookie use
23 » // restrictions such as in RFC 6265. 23 » // restrictions such as in RFC 6265.
24 Cookies(u *url.URL) []*Cookie 24 Cookies(u *url.URL) []*Cookie
25 } 25 }
26
27 type blackHoleJar struct{}
28
29 func (blackHoleJar) SetCookies(u *url.URL, cookies []*Cookie) {}
30 func (blackHoleJar) Cookies(u *url.URL) []*Cookie { return nil }
OLDNEW
« src/pkg/net/http/client.go ('K') | « src/pkg/net/http/client_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b