Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
secure
✓ github.com/gin-contrib/secure
Adds secure headers to a Gin router.
package main
import (
"github.com/gin-contrib/secure"
"github.com/gin-gonic/gin"
)
func main() {
r := gin.Default()
r.Use(secure.New(secure.Config{
AllowedHosts: []string{"example.com"},
}))
r.GET("/", func(c *gin.Context) {
c.String(200, "Secure!")
})
r.Run()
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
1.1.3latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.