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
path: root/app.go
diff options
context:
space:
mode:
authorJaime Martinez <jmartinez@gitlab.com>2021-04-30 09:35:13 +0300
committerJaime Martinez <jmartinez@gitlab.com>2021-05-11 10:28:42 +0300
commitdf52e3d3f98186ef29e912320bbfdacb768ad7c8 (patch)
treedb0108cc56a23a4918afca587957e0bf9847421d /app.go
parent8ea4cb76586c0841456c5973168cd8451f6c6c0a (diff)
Fail if disk is disabled
Return disk disabled error Remove useLegacyStorage leftovers Fix run process
Diffstat (limited to 'app.go')
-rw-r--r--app.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/app.go b/app.go
index f6ec142e..058fd3ad 100644
--- a/app.go
+++ b/app.go
@@ -35,6 +35,7 @@ import (
"gitlab.com/gitlab-org/gitlab-pages/internal/request"
"gitlab.com/gitlab-org/gitlab-pages/internal/serving/disk/zip"
"gitlab.com/gitlab-org/gitlab-pages/internal/source"
+ "gitlab.com/gitlab-org/gitlab-pages/internal/source/gitlab"
"gitlab.com/gitlab-org/gitlab-pages/metrics"
)
@@ -131,7 +132,14 @@ func (a *theApp) tryAuxiliaryHandlers(w http.ResponseWriter, r *http.Request, ht
return true
}
- if !domain.HasLookupPath(r) {
+ if err := domain.HasLookupPath(r); err != nil {
+ if errors.Is(err, gitlab.ErrDiskDisabled) {
+ errortracking.Capture(err)
+ log.WithError(err).Error("tried to serve from disk")
+ httperrors.Serve500(w)
+ return true
+ }
+
// redirect to auth and serve not found
if a.checkAuthAndServeNotFound(domain, w, r) {
return true