We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent edacd7e commit 5c90cabCopy full SHA for 5c90cab
1 file changed
app/run.go
@@ -21,15 +21,15 @@ func SetupRouter(vs *verify.VerifySvc) *gin.Engine {
21
panic("AUTH_HEADER_NAME and AUTH_HEADER_VALUE must be set")
22
}
23
24
- r.Use(func(c *gin.Context) {
+ tppGroup := r.Group("/tpp")
25
+ tppGroup.Use(func(c *gin.Context) {
26
if c.GetHeader(headerName) != headerValue {
27
c.AbortWithStatusJSON(http.StatusForbidden, gin.H{"error": "Invalid or missing header"})
28
return
29
30
c.Next()
31
})
-
32
- r.POST("/tpp/verify", vs.Verify)
+ tppGroup.POST("/verify", vs.Verify)
33
r.GET("/health", func(c *gin.Context) {
34
c.JSON(http.StatusOK, gin.H{"status": "ok"})
35
0 commit comments