feat: add option to disable resources server

This commit is contained in:
Stavros
2025-09-22 15:52:43 +03:00
parent e114bf0943
commit f8047a6c2e
5 changed files with 17 additions and 17 deletions

View File

@@ -7,7 +7,8 @@ import (
)
type ResourcesControllerConfig struct {
ResourcesDir string
ResourcesDir string
ResourcesDisabled bool
}
type ResourcesController struct {
@@ -38,5 +39,12 @@ func (controller *ResourcesController) resourcesHandler(c *gin.Context) {
})
return
}
if controller.config.ResourcesDisabled {
c.JSON(403, gin.H{
"status": 403,
"message": "Resources are disabled",
})
return
}
controller.fileServer.ServeHTTP(c.Writer, c.Request)
}