mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 16:58:31 +02:00
cleanup and simplify middleware implementations, refactor some other code
This commit is contained in:
@@ -75,7 +75,7 @@ func Handler(w http.ResponseWriter, r *http.Request) {
|
||||
// On nginx, when route for domain does not exist, it returns StatusBadGateway.
|
||||
// Then scraper / scanners will know the subdomain is invalid.
|
||||
// With StatusNotFound, they won't know whether it's the path, or the subdomain that is invalid.
|
||||
if !middleware.ServeStaticErrorPageFile(w, r) {
|
||||
if served := middleware.ServeStaticErrorPageFile(w, r); !served {
|
||||
logger.Err(err).Str("method", r.Method).Str("url", r.URL.String()).Msg("request")
|
||||
errorPage, ok := errorpage.GetErrorPageByStatus(http.StatusNotFound)
|
||||
if ok {
|
||||
|
||||
Reference in New Issue
Block a user