Skip to content

Commit

Permalink
Remove formatting from internalServerError
Browse files Browse the repository at this point in the history
Co-authored-by: Troels Thomsen <19824+tt@users.noreply.github.com>
  • Loading branch information
kennyp and tt committed Mar 15, 2024
1 parent 3beb950 commit 0867219
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions dynoid/middleware/dynoid.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,10 @@ func tokenFromHeader(r *http.Request) string {
return ""
}

func internalServerError(format string, v ...any) func(http.Handler) http.Handler {
func internalServerError(error string) func(http.Handler) http.Handler {
return func(http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusInternalServerError)
fmt.Fprintf(w, format, v...)
http.Error(w, error, http.StatusInternalServerError)
})
}
}

0 comments on commit 0867219

Please sign in to comment.