fix(op): initialize http Headers in response objects
This commit is contained in:
parent
de034c8d24
commit
f2545780c8
1 changed files with 6 additions and 2 deletions
|
@ -218,7 +218,8 @@ type Response struct {
|
|||
// without custom headers.
|
||||
func NewResponse(data any) *Response {
|
||||
return &Response{
|
||||
Data: data,
|
||||
Header: make(http.Header),
|
||||
Data: data,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -242,7 +243,10 @@ type Redirect struct {
|
|||
}
|
||||
|
||||
func NewRedirect(url string) *Redirect {
|
||||
return &Redirect{URL: url}
|
||||
return &Redirect{
|
||||
Header: make(http.Header),
|
||||
URL: url,
|
||||
}
|
||||
}
|
||||
|
||||
func (red *Redirect) writeOut(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue