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:
authorfeistel <6742251-feistel@users.noreply.gitlab.com>2022-06-27 11:27:04 +0300
committerfeistel <6742251-feistel@users.noreply.gitlab.com>2022-06-27 11:27:04 +0300
commitbadac3a123f87168e1da077b7fba06b4e2f9ce4b (patch)
tree5c455f933e08fe2f511c44bad66fe565a1355939 /internal
parent4453ff4b08fcbff9955029d8233f75ec1e171760 (diff)
Do not log an error when serving 404 in routing middleware
Diffstat (limited to 'internal')
-rw-r--r--internal/routing/middleware.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/routing/middleware.go b/internal/routing/middleware.go
index 8272635a..1b15f55c 100644
--- a/internal/routing/middleware.go
+++ b/internal/routing/middleware.go
@@ -20,13 +20,13 @@ 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) {
- logging.LogRequest(r).WithError(err).Error("could not fetch domain information from a source")
-
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)
return
}