mirror of
https://github.com/diamondburned/arikawa.git
synced 2024-11-30 10:43:30 +00:00
httpdriver: Fix MockRequest.AddHeader crash
This commit is contained in:
parent
b3b2478481
commit
99e5f6c2b8
|
@ -79,6 +79,10 @@ func (r *MockRequest) GetContext() context.Context {
|
|||
}
|
||||
|
||||
func (r *MockRequest) AddHeader(h http.Header) {
|
||||
if r.Header == nil {
|
||||
r.Header = make(http.Header)
|
||||
}
|
||||
|
||||
for k, v := range h {
|
||||
r.Header[k] = append(r.Header[k], v...)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue