Skip to content

Commit

Permalink
fix checking for locationWithContextErr as calling location with context
Browse files Browse the repository at this point in the history
creates a new slice of errors, causing the condition to always be true
  • Loading branch information
julianooi committed Nov 27, 2023
1 parent cd6d03d commit 9703a2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion response.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (r Response) Clone() Response {

// Write applies the defined HTMX headers to a given response writer.
func (r Response) Write(w http.ResponseWriter) error {
if r.locationWithContextErr != nil {
if len(r.locationWithContextErr) > 0 {
return errors.Join(r.locationWithContextErr...)
}

Expand Down

0 comments on commit 9703a2d

Please sign in to comment.