Add support for serving index.html for sub-dirs
This commit is contained in:
parent
4e4baa154c
commit
541367fcc4
@ -68,6 +68,11 @@ func (c *Client) Open(user, path string) (fs.File, error) {
|
|||||||
filepath = "index.html"
|
filepath = "index.html"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If it's a dir, give them index.html
|
||||||
|
if strings.HasSuffix(filepath, "/") {
|
||||||
|
*filepath += "index.html"
|
||||||
|
}
|
||||||
|
|
||||||
allowed := c.allowsPages(user, repo)
|
allowed := c.allowsPages(user, repo)
|
||||||
log.Printf("allowed? %t", allowed)
|
log.Printf("allowed? %t", allowed)
|
||||||
if !allowed && repo != fmt.Sprintf("%s.%s", user, c.domain) {
|
if !allowed && repo != fmt.Sprintf("%s.%s", user, c.domain) {
|
||||||
|
Loading…
Reference in New Issue
Block a user