18 lines
331 B
Go
18 lines
331 B
Go
package controllers
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"gitea.tbdevent.eu/TBD/reforger_crawler_main/initializers"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func CheckAllowed(c *gin.Context) {
|
|
secret := c.GetHeader("X-SECRET-KEY")
|
|
if secret != initializers.SECRET {
|
|
c.JSON(http.StatusForbidden, gin.H{"error": "Forbidden"})
|
|
c.Abort()
|
|
return
|
|
}
|
|
}
|