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:
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user