Disallow listing artifact directory
This commit is contained in:
parent
e3a911cd05
commit
c60b4ddf73
6
app.go
6
app.go
@ -34,7 +34,11 @@ func NewApp() App {
|
|||||||
|
|
||||||
artifacts := http.Dir("./artifacts")
|
artifacts := http.Dir("./artifacts")
|
||||||
router.GET("/artifacts/*path", func(c *gin.Context) {
|
router.GET("/artifacts/*path", func(c *gin.Context) {
|
||||||
c.FileFromFS(c.Param("path"), artifacts)
|
if c.Param("path") == "/" {
|
||||||
|
c.JSON(http.StatusForbidden, gin.H{"error": "Forbidden"})
|
||||||
|
} else {
|
||||||
|
c.FileFromFS(c.Param("path"), artifacts)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
router.GET("/api/version", func(c *gin.Context) {
|
router.GET("/api/version", func(c *gin.Context) {
|
||||||
|
Reference in New Issue
Block a user