Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CorsMiddleware = middleware.CORSWithConfig(middleware.CORSConfig{ AllowOrigins: []string{"localhost" + config.HTTPPort, "localhost" + config.HTTPSPort}, AllowHeaders: []string{echo.HeaderOrigin, echo.HeaderContentType, echo.HeaderAccept}, })
CorsMiddleware handles Cross-Origin-Resource-Sharing
View Source
var GzipMiddleware = middleware.GzipWithConfig(middleware.GzipConfig{ Level: gzip.BestCompression, })
GzipMiddleware compresses HTTP response using gzip compression scheme on the fly
View Source
var RecoverMiddleware = middleware.Recover()
RecoverMiddleware recovers the server on error
View Source
var SecureMiddleware = middleware.SecureWithConfig(middleware.SecureConfig{
XSSProtection: "1; mode=block",
ContentTypeNosniff: "nosniff",
XFrameOptions: "SAMEORIGIN",
HSTSMaxAge: 3600,
ContentSecurityPolicy: "default-src 'self'",
})
SecureMiddleware provides protection against cross-site scripting (XSS) attack, content type sniffing, clickjacking, insecure connection and other code injection attacks
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.