Skip to content

Commit dedd217

Browse files
author
Zachary Gershman
committed
net/http: adds redirect header documentation
1 parent eefe499 commit dedd217

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/net/http/client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ type Client struct {
8282
//
8383
// If RedirectHeader is nil, all headers will be forwarded on all
8484
// subsequent redirects.
85+
//
86+
// Headers "Authorization", "Www-Authenticate", "Cookie",
87+
// and "Cookie2" bypass this function and are sent along
88+
// on all redirects.
8589
RedirectHeader func(headerKey string) bool
8690

8791
// Jar specifies the cookie jar.

src/net/http/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ func TestShouldCopyHeaderOnRedirect(t *testing.T) {
16921692
t.Errorf("%d. dest URL %q parse error: %v", i, tt.destURL, err)
16931693
continue
16941694
}
1695-
got := Export_shouldCopyHeaderOnRedirect(tt.header, u0, u1)
1695+
got := Export_shouldCopyHeaderOnRedirect(tt.header, u0, u1, tt.headerPolicy)
16961696
if got != tt.want {
16971697
t.Errorf("%d. shouldCopyHeaderOnRedirect(%q, %q => %q) = %v; want %v",
16981698
i, tt.header, tt.initialURL, tt.destURL, got, tt.want)

0 commit comments

Comments
 (0)