Browse Source

trying to clean

AETH-erial 2 months ago
parent
commit
b371d46553
2 changed files with 4 additions and 2 deletions
  1. 2 1
      pkg/controller/cdn_handlers.go
  2. 2 1
      pkg/routes/register.go

+ 2 - 1
pkg/controller/cdn_handlers.go

@@ -2,6 +2,7 @@ package controller
 
 import (
 	"fmt"
+	"strings"
 	"os"
 
 	"git.aetherial.dev/aeth/keiji/pkg/helpers"
@@ -162,7 +163,7 @@ func (c *Controller) ServeGeneric(ctx *gin.Context) {
 		})
 		return
 	}
-	fext := strings.Split(f, ".")[len()strings.Split(f, ".")-1]
+	fext := strings.Split(f, ".")[len(strings.Split(f, "."))-1]
 	var ctype string
 	switch {
 	case fext == "css":

+ 2 - 1
pkg/routes/register.go

@@ -25,7 +25,8 @@ func Register(e *gin.Engine, root string, domain string, redisPort string, redis
 	cdn.GET("/style/mdb/:file", c.ServeMdbCss)
 	cdn.GET("/assets/:file", c.ServeAsset)
 	cdn.GET("/images/:file", c.ServeImage)
-	cdn.GET("/cdn/:file", c.ServeGeneric)	cdn.GET("/htmx/:file", c.ServeHtmx)
+	cdn.GET("/cdn/:file", c.ServeGeneric)
+	cdn.GET("/htmx/:file", c.ServeHtmx)