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:
authorTuomo Ala-Vannesluoma <tuomoav@gmail.com>2018-09-30 16:02:58 +0300
committerTuomo Ala-Vannesluoma <tuomoav@gmail.com>2018-09-30 16:02:58 +0300
commitc84c03d5fecb2214fe8fb43ad740ccf37a967990 (patch)
tree3244c51a48632070e9bf14ed51757d04556d907c /app.go
parentc69313b2ed71fbecd8acca283954dc3cfe424acb (diff)
Fix returning and calling function
Diffstat (limited to 'app.go')
-rw-r--r--app.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/app.go b/app.go
index 295bc7c8..a8810da3 100644
--- a/app.go
+++ b/app.go
@@ -184,15 +184,15 @@ func (a *theApp) serveContent(ww http.ResponseWriter, r *http.Request, https boo
// Serve static file, applying CORS headers if necessary
if a.DisableCrossOriginRequests {
- a.serveFileOrNotFound(domain, &w, r)
+ a.serveFileOrNotFound(domain)(&w, r)
} else {
- corsHandler.ServeHTTP(&w, r, a.serveFileOrNotFound(domain, &w, r))
+ corsHandler.ServeHTTP(&w, r, a.serveFileOrNotFound(domain))
}
metrics.ProcessedRequests.WithLabelValues(strconv.Itoa(w.status), r.Method).Inc()
}
-func (a *theApp) serveFileOrNotFound(domain *domain.D, ww http.ResponseWriter, r *http.Request) http.HandlerFunc {
+func (a *theApp) serveFileOrNotFound(domain *domain.D) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
fileServed := domain.ServeFileHTTP(w, r)
@@ -202,11 +202,11 @@ func (a *theApp) serveFileOrNotFound(domain *domain.D, ww http.ResponseWriter, r
// namespace project is public.
if domain.IsNamespaceProject(r) {
- if a.Auth.CheckAuthenticationWithoutProject(ww, r) {
+ if a.Auth.CheckAuthenticationWithoutProject(w, r) {
return
}
- httperrors.Serve404(ww)
+ httperrors.Serve404(w)
return
}