diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2021-04-30 09:35:13 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2021-05-11 10:28:42 +0300 |
commit | df52e3d3f98186ef29e912320bbfdacb768ad7c8 (patch) | |
tree | db0108cc56a23a4918afca587957e0bf9847421d /app.go | |
parent | 8ea4cb76586c0841456c5973168cd8451f6c6c0a (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.go | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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 |