Add development errors mode

This commit is contained in:
DarthSim
2019-05-08 20:51:39 +06:00
parent 023dcadc34
commit bd95447ca5
3 changed files with 12 additions and 1 deletions

View File

@@ -175,7 +175,12 @@ func respondWithError(reqID string, rw http.ResponseWriter, err *imgproxyError)
logResponse(reqID, err.StatusCode, err.Message)
rw.WriteHeader(err.StatusCode)
rw.Write([]byte(err.PublicMessage))
if conf.DevelopmentErrorsMode {
rw.Write([]byte(err.Message))
} else {
rw.Write([]byte(err.PublicMessage))
}
}
func respondWithOptions(reqID string, rw http.ResponseWriter) {