mirror of https://github.com/gofiber/fiber.git
39 lines
1.1 KiB
Go
39 lines
1.1 KiB
Go
package middleware
|
|
|
|
import (
|
|
"github.com/gofiber/fiber"
|
|
)
|
|
|
|
// Middleware types
|
|
type (
|
|
// HelmetConfig defines the config for Hel;met middleware.
|
|
HelmetConfig struct {
|
|
// Next defines a function to skip this middleware.
|
|
Next func(ctx *fiber.Ctx) bool
|
|
|
|
ContentSecurityPolicy string // x
|
|
CrossDomain string // x
|
|
DNSPrefetchControl bool // ✓
|
|
ExpectCTMaxAge int // x
|
|
ExpectCTEnfore bool // x
|
|
ExpectCTReportURI string // x
|
|
FeaturePolicy map[string]string // x
|
|
FrameGuard string // ✓
|
|
HSTSMaxAge int // ✓
|
|
HSTSExcludeSubDomains bool // ✓
|
|
IEnoOpen bool // ✓
|
|
NoSniff bool // ✓
|
|
ReferrerPolicy string // x
|
|
XSSFilter bool // ✓
|
|
XSSFilterReportURI string // ✓
|
|
}
|
|
)
|
|
|
|
// Helmet helps secure your apps by setting various HTTP headers
|
|
func Helmet() fiber.Handler {
|
|
return func(ctx *fiber.Ctx) {
|
|
// Continue stack
|
|
ctx.Next()
|
|
}
|
|
}
|