mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-07-04 17:06:49 +00:00
Proper 404's for objects
This commit is contained in:
@ -81,6 +81,16 @@ func ResultErrorJSON(w http.ResponseWriter, r *http.Request, status int, message
|
||||
ResultResponseJSON(w, r, status, errorResponse)
|
||||
}
|
||||
|
||||
// NotFound will return a 404 response
|
||||
func NotFound(w http.ResponseWriter, r *http.Request) {
|
||||
errorResponse := ErrorResponse{
|
||||
Code: http.StatusNotFound,
|
||||
Message: "Not found",
|
||||
}
|
||||
|
||||
ResultResponseJSON(w, r, http.StatusNotFound, errorResponse)
|
||||
}
|
||||
|
||||
// ResultResponseText will write the result as text to the http output
|
||||
func ResultResponseText(w http.ResponseWriter, r *http.Request, status int, content string) {
|
||||
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
|
||||
|
Reference in New Issue
Block a user