middleware

package
v0.0.0-...-105f702 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2020 License: MIT Imports: 4 Imported by: 0

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL