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/source/disk/group.go')
-rw-r--r--internal/source/disk/group.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/internal/source/disk/group.go b/internal/source/disk/group.go
index 9f466bc4..e0365bbd 100644
--- a/internal/source/disk/group.go
+++ b/internal/source/disk/group.go
@@ -8,6 +8,7 @@ import (
"gitlab.com/gitlab-org/gitlab-pages/internal/host"
"gitlab.com/gitlab-org/gitlab-pages/internal/serving"
+ "gitlab.com/gitlab-org/gitlab-pages/internal/serving/disk"
)
const (
@@ -77,11 +78,13 @@ func (g *Group) getProjectConfigWithSubpath(r *http.Request) (*projectConfig, st
// Resolve tries to find project and its config recursively for a given request
// to a group domain
-func (g *Group) Resolve(r *http.Request) (*serving.LookupPath, string, error) {
+func (g *Group) Resolve(r *http.Request) (*serving.Request, error) {
projectConfig, prefix, projectPath, subPath := g.getProjectConfigWithSubpath(r)
if projectConfig == nil {
- return nil, "", nil // it is not an error when project does not exist
+ // it is not an error when project does not exist, in that case
+ // serving.Request.LookupPath is nil.
+ return &serving.Request{Serving: disk.New()}, nil
}
lookupPath := &serving.LookupPath{
@@ -93,5 +96,9 @@ func (g *Group) Resolve(r *http.Request) (*serving.LookupPath, string, error) {
ProjectID: projectConfig.ID,
}
- return lookupPath, subPath, nil
+ return &serving.Request{
+ Serving: disk.New(),
+ LookupPath: lookupPath,
+ SubPath: subPath,
+ }, nil
}