From 3a2bc89fbdadca3cb9314accd0e292dd8baecdb2 Mon Sep 17 00:00:00 2001 From: Neur0toxine Date: Sun, 12 Nov 2023 23:44:57 +0300 Subject: [PATCH] fix for static --- gitea/gitea.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gitea/gitea.go b/gitea/gitea.go index 2034435..1174fd4 100644 --- a/gitea/gitea.go +++ b/gitea/gitea.go @@ -54,9 +54,13 @@ func (c *Client) Open(user, path string) (fs.File, error) { parts := strings.Split(strings.TrimLeft(path, "/"), "/") log.Printf("parts: %d #%v", len(parts), parts) - if len(parts) > 1 && !strings.Contains(parts[0], ".") { + if len(parts) > 1 { repo = parts[0] filepath = strings.Join(parts[1:], "/") + if strings.Contains(parts[len(parts)-1], ".") { + repo = fmt.Sprintf("%s.%s", user, c.domain) + filepath = path + } } else { repo = fmt.Sprintf("%s.%s", user, c.domain) filepath = path