Skip to content

Commit

Permalink
Refactor error handling in middleware.go
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mizutani committed Jan 20, 2024
1 parent 36d88f1 commit 4e1a7a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controller/server/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func Authorize(authz *policy.Client, getEnv interfaces.Env) func(next http.Handl
if err != nil {
utils.HandleError(err)
w.WriteHeader(http.StatusBadRequest)
w.Write([]byte(err.Error()))
utils.SafeWrite(w, []byte(err.Error()))
return
}
defer utils.SafeClose(reader)
Expand Down

0 comments on commit 4e1a7a0

Please sign in to comment.