Skip to content

Commit d34d122

Browse files
committed
fix(static-server): use ghcr
1 parent b0782c1 commit d34d122

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apps/static-server/internal/handler/static.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ func (h *StaticHandler) ServeFiles(c *gin.Context) {
3232
return
3333
}
3434
objectPath := strings.TrimPrefix(c.Request.URL.Path, "/")
35-
// Add bucket name as directory prefix
36-
objectPath = path.Join(bucket, objectPath)
37-
if strings.HasSuffix(objectPath, "/") || objectPath == bucket {
35+
if strings.HasSuffix(objectPath, "/") || objectPath == "" {
3836
objectPath = path.Join(objectPath, "index.html")
3937
}
38+
// Add bucket name as prefix for object path
39+
objectPath = path.Join(bucket, objectPath)
4040

4141
if !h.storage.ObjectExists(c, bucket, objectPath) {
4242
if !strings.HasSuffix(objectPath, ".html") {

0 commit comments

Comments
 (0)