AnonymousOverflow/src/routes/static.go

15 lines
234 B
Go
Raw Normal View History

2023-02-04 13:14:52 -05:00
package routes
import (
"fmt"
"strings"
"github.com/gin-gonic/gin"
)
func StaticContent(c *gin.Context) {
cleanFilePath := strings.ReplaceAll(c.Param("filepath"), "..", "")
c.File(fmt.Sprintf("./public/%s", cleanFilePath))
}