We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0782c1 commit d34d122Copy full SHA for d34d122
apps/static-server/internal/handler/static.go
@@ -32,11 +32,11 @@ func (h *StaticHandler) ServeFiles(c *gin.Context) {
32
return
33
}
34
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 {
+ if strings.HasSuffix(objectPath, "/") || objectPath == "" {
38
objectPath = path.Join(objectPath, "index.html")
39
+ // Add bucket name as prefix for object path
+ objectPath = path.Join(bucket, objectPath)
40
41
if !h.storage.ObjectExists(c, bucket, objectPath) {
42
if !strings.HasSuffix(objectPath, ".html") {
0 commit comments