Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'internal/routing/middleware.go')
-rw-r--r--internal/routing/middleware.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/routing/middleware.go b/internal/routing/middleware.go
index bee7c9df..1b15f55c 100644
--- a/internal/routing/middleware.go
+++ b/internal/routing/middleware.go
@@ -1,6 +1,7 @@
package routing
import (
+ "context"
"errors"
"net/http"
@@ -19,6 +20,11 @@ func NewMiddleware(handler http.Handler, s source.Source) http.Handler {
// middleware chain and simply respond with 502 after logging this
d, err := getDomain(r, s)
if err != nil && !errors.Is(err, domain.ErrDomainDoesNotExist) {
+ if errors.Is(err, context.Canceled) {
+ httperrors.Serve404(w)
+ return
+ }
+
logging.LogRequest(r).WithError(err).Error("could not fetch domain information from a source")
httperrors.Serve502(w)