blob: f120cb650d839430fc108061fd88d0754fc4c438 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
package disk
import (
"net/http"
"gitlab.com/gitlab-org/gitlab-pages/internal/serving"
"gitlab.com/gitlab-org/gitlab-pages/internal/serving/disk/local"
)
type customProjectResolver struct {
config *domainConfig
path string
}
func (p *customProjectResolver) Resolve(r *http.Request) (*serving.Request, error) {
lookupPath := &serving.LookupPath{
Prefix: "/",
Path: p.path,
IsNamespaceProject: false,
IsHTTPSOnly: p.config.HTTPSOnly,
HasAccessControl: p.config.AccessControl,
ProjectID: p.config.ID,
}
return &serving.Request{
Serving: local.Instance(),
LookupPath: lookupPath,
SubPath: r.URL.Path,
}, nil
}
|