Copy http.Header for each Target

Fixes #30 and likely other nasty problems with the internals of the http.Client
mutating the shared Header. Thanks @timjnh for reporting.
This commit is contained in:
Tomás Senart
2013-10-31 00:09:47 +01:00
parent 8659c293e3
commit 1517f2da05
2 changed files with 11 additions and 1 deletions

View File

@@ -62,4 +62,9 @@ func TestSetHeader(t *testing.T) {
t.Errorf("Want: %s, Got: %s", want, got)
}
}
// Test Header copy
targets[0].Header.Set("Authorization", "0")
if targets[1].Header.Get("Authorization") == "0" {
t.Error("Each Target must have it's own Header")
}
}