{"modulePath":"github.com/Code-Hex/echo","version":"v3.0.3+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package middleware\n\n## Constants\n\n```go\nconst (\n\tAlgorithmHS256 = \"HS256\"\n)\n```\nAlgorithims\n\n## Variables\n\n```go\nvar (\n\t// DefaultBasicAuthConfig is the default BasicAuth middleware config.\n\tDefaultBasicAuthConfig = BasicAuthConfig{\n\t\tSkipper: defaultSkipper,\n\t}\n)\n```\n\n```go\nvar (\n\t// DefaultBodyLimitConfig is the default Gzip middleware config.\n\tDefaultBodyLimitConfig = BodyLimitConfig{\n\t\tSkipper: defaultSkipper,\n\t}\n)\n```\n\n```go\nvar (\n\t// DefaultCORSConfig is the default CORS middleware config.\n\tDefaultCORSConfig = CORSConfig{\n\t\tSkipper:      defaultSkipper,\n\t\tAllowOrigins: []string{\"*\"},\n\t\tAllowMethods: []string{echo.GET, echo.HEAD, echo.PUT, echo.PATCH, echo.POST, echo.DELETE},\n\t}\n)\n```\n\n```go\nvar (\n\t// DefaultCSRFConfig is the default CSRF middleware config.\n\tDefaultCSRFConfig = CSRFConfig{\n\t\tSkipper:      defaultSkipper,\n\t\tTokenLength:  32,\n\t\tTokenLookup:  \"header:\" + echo.HeaderXCSRFToken,\n\t\tContextKey:   \"csrf\",\n\t\tCookieName:   \"_csrf\",\n\t\tCookieMaxAge: 86400,\n\t}\n)\n```\n\n```go\nvar (\n\t// DefaultGzipConfig is the default Gzip middleware config.\n\tDefaultGzipConfig = GzipConfig{\n\t\tSkipper: defaultSkipper,\n\t\tLevel:   -1,\n\t}\n)\n```\n\n```go\nvar (\n\t// DefaultJWTConfig is the default JWT auth middleware config.\n\tDefaultJWTConfig = JWTConfig{\n\t\tSkipper:       defaultSkipper,\n\t\tSigningMethod: AlgorithmHS256,\n\t\tContextKey:    \"user\",\n\t\tTokenLookup:   \"header:\" + echo.HeaderAuthorization,\n\t\tClaims:        jwt.MapClaims{},\n\t}\n)\n```\n\n```go\nvar (\n\t// DefaultLoggerConfig is the default Logger middleware config.\n\tDefaultLoggerConfig = LoggerConfig{\n\t\tSkipper: defaultSkipper,\n\t\tFormat: `{\"time\":\"${time_rfc3339}\",\"remote_ip\":\"${remote_ip}\",\"host\":\"${host}\",` +\n\t\t\t`\"method\":\"${method}\",\"uri\":\"${uri}\",\"status\":${status}, \"latency\":${latency},` +\n\t\t\t`\"latency_human\":\"${latency_human}\",\"bytes_in\":${bytes_in},` +\n\t\t\t`\"bytes_out\":${bytes_out}}` + \"\\n\",\n\t\tOutput: os.Stdout,\n\t\t// contains filtered or unexported fields\n\t}\n)\n```\n\n```go\nvar (\n\t// DefaultMethodOverrideConfig is the default MethodOverride middleware config.\n\tDefaultMethodOverrideConfig = MethodOverrideConfig{\n\t\tSkipper: defaultSkipper,\n\t\tGetter:  MethodFromHeader(echo.HeaderXHTTPMethodOverride),\n\t}\n)\n```\n\n```go\nvar (\n\t// DefaultRecoverConfig is the default Recover middleware config.\n\tDefaultRecoverConfig = RecoverConfig{\n\t\tSkipper:           defaultSkipper,\n\t\tStackSize:         4 \u003c\u003c 10,\n\t\tDisableStackAll:   false,\n\t\tDisablePrintStack: false,\n\t}\n)\n```\n\n```go\nvar (\n\t// DefaultRedirectConfig is the default Redirect middleware config.\n\tDefaultRedirectConfig = RedirectConfig{\n\t\tSkipper: defaultSkipper,\n\t\tCode:    http.StatusMovedPermanently,\n\t}\n)\n```\n\n```go\nvar (\n\t// DefaultSecureConfig is the default Secure middleware config.\n\tDefaultSecureConfig = SecureConfig{\n\t\tSkipper:            defaultSkipper,\n\t\tXSSProtection:      \"1; mode=block\",\n\t\tContentTypeNosniff: \"nosniff\",\n\t\tXFrameOptions:      \"SAMEORIGIN\",\n\t}\n)\n```\n\n```go\nvar (\n\t// DefaultTrailingSlashConfig is the default TrailingSlash middleware config.\n\tDefaultTrailingSlashConfig = TrailingSlashConfig{\n\t\tSkipper: defaultSkipper,\n\t}\n)\n```\n\n## Functions\n\n```go\nfunc AddTrailingSlash() echo.MiddlewareFunc\n```\nAddTrailingSlash returns a root level (before router) middleware which adds a trailing slash to the request \\`URL#Path\\`.\n\nUsage \\`Echo#Pre(AddTrailingSlash())\\`\n\n```go\nfunc AddTrailingSlashWithConfig(config TrailingSlashConfig) echo.MiddlewareFunc\n```\nAddTrailingSlashWithConfig returns a AddTrailingSlash middleware with config. See \\`AddTrailingSlash()\\`.\n\n```go\nfunc BasicAuth(fn BasicAuthValidator) echo.MiddlewareFunc\n```\nBasicAuth returns an BasicAuth middleware.\n\nFor valid credentials it calls the next handler. For invalid credentials, it sends \"401 - Unauthorized\" response. For empty or invalid \\`Authorization\\` header, it sends \"400 - Bad Request\" response.\n\n```go\nfunc BasicAuthWithConfig(config BasicAuthConfig) echo.MiddlewareFunc\n```\nBasicAuthWithConfig returns an BasicAuth middleware with config. See \\`BasicAuth()\\`.\n\n```go\nfunc BodyLimit(limit string) echo.MiddlewareFunc\n```\nBodyLimit returns a BodyLimit middleware.\n\nBodyLimit middleware sets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends \"413 - Request Entity Too Large\" response. The BodyLimit is determined based on both \\`Content-Length\\` request header and actual content read, which makes it super secure. Limit can be specified as \\`4x\\` or \\`4xB\\`, where x is one of the multiple from K, M, G, T or P.\n\n```go\nfunc BodyLimitWithConfig(config BodyLimitConfig) echo.MiddlewareFunc\n```\nBodyLimitWithConfig returns a BodyLimit middleware with config. See: \\`BodyLimit()\\`.\n\n```go\nfunc CORS() echo.MiddlewareFunc\n```\nCORS returns a Cross-Origin Resource Sharing (CORS) middleware. See: [https://developer.mozilla.org/en/docs/Web/HTTP/Access\\_control\\_CORS](https://developer.mozilla.org/en/docs/Web/HTTP/Access_control_CORS)\n\n```go\nfunc CORSWithConfig(config CORSConfig) echo.MiddlewareFunc\n```\nCORSWithConfig returns a CORS middleware with config. See: \\`CORS()\\`.\n\n```go\nfunc CSRF() echo.MiddlewareFunc\n```\nCSRF returns a Cross-Site Request Forgery (CSRF) middleware. See: [https://en.wikipedia.org/wiki/Cross-site\\_request\\_forgery](https://en.wikipedia.org/wiki/Cross-site_request_forgery)\n\n```go\nfunc CSRFWithConfig(config CSRFConfig) echo.MiddlewareFunc\n```\nCSRFWithConfig returns a CSRF middleware with config. See \\`CSRF()\\`.\n\n```go\nfunc Gzip() echo.MiddlewareFunc\n```\nGzip returns a middleware which compresses HTTP response using gzip compression scheme.\n\n```go\nfunc GzipWithConfig(config GzipConfig) echo.MiddlewareFunc\n```\nGzipWithConfig return Gzip middleware with config. See: \\`Gzip()\\`.\n\n```go\nfunc HTTPSNonWWWRedirect() echo.MiddlewareFunc\n```\nHTTPSNonWWWRedirect redirects http requests to https non www. For example, [http://www.labstack.com](http://www.labstack.com) will be redirect to [https://labstack.com](https://labstack.com).\n\nUsage \\`Echo#Pre(HTTPSNonWWWRedirect())\\`\n\n```go\nfunc HTTPSNonWWWRedirectWithConfig(config RedirectConfig) echo.MiddlewareFunc\n```\nHTTPSNonWWWRedirectWithConfig returns an HTTPSRedirect middleware with config. See \\`HTTPSNonWWWRedirect()\\`.\n\n```go\nfunc HTTPSRedirect() echo.MiddlewareFunc\n```\nHTTPSRedirect redirects http requests to https. For example, [http://labstack.com](http://labstack.com) will be redirect to [https://labstack.com](https://labstack.com).\n\nUsage \\`Echo#Pre(HTTPSRedirect())\\`\n\n```go\nfunc HTTPSRedirectWithConfig(config RedirectConfig) echo.MiddlewareFunc\n```\nHTTPSRedirectWithConfig returns an HTTPSRedirect middleware with config. See \\`HTTPSRedirect()\\`.\n\n```go\nfunc HTTPSWWWRedirect() echo.MiddlewareFunc\n```\nHTTPSWWWRedirect redirects http requests to https www. For example, [http://labstack.com](http://labstack.com) will be redirect to [https://www.labstack.com](https://www.labstack.com).\n\nUsage \\`Echo#Pre(HTTPSWWWRedirect())\\`\n\n```go\nfunc HTTPSWWWRedirectWithConfig(config RedirectConfig) echo.MiddlewareFunc\n```\nHTTPSWWWRedirectWithConfig returns an HTTPSRedirect middleware with config. See \\`HTTPSWWWRedirect()\\`.\n\n```go\nfunc JWT(key []byte) echo.MiddlewareFunc\n```\nJWT returns a JSON Web Token (JWT) auth middleware.\n\nFor valid token, it sets the user in context and calls next handler. For invalid token, it returns \"401 - Unauthorized\" error. For empty token, it returns \"400 - Bad Request\" error.\n\nSee: [https://jwt.io/introduction](https://jwt.io/introduction) See \\`JWTConfig.TokenLookup\\`\n\n```go\nfunc JWTWithConfig(config JWTConfig) echo.MiddlewareFunc\n```\nJWTWithConfig returns a JWT auth middleware with config. See: \\`JWT()\\`.\n\n```go\nfunc Logger() echo.MiddlewareFunc\n```\nLogger returns a middleware that logs HTTP requests.\n\n```go\nfunc LoggerWithConfig(config LoggerConfig) echo.MiddlewareFunc\n```\nLoggerWithConfig returns a Logger middleware with config. See: \\`Logger()\\`.\n\n```go\nfunc MethodOverride() echo.MiddlewareFunc\n```\nMethodOverride returns a MethodOverride middleware. MethodOverride  middleware checks for the overridden method from the request and uses it instead of the original method.\n\nFor security reasons, only \\`POST\\` method can be overridden.\n\n```go\nfunc MethodOverrideWithConfig(config MethodOverrideConfig) echo.MiddlewareFunc\n```\nMethodOverrideWithConfig returns a MethodOverride middleware with config. See: \\`MethodOverride()\\`.\n\n```go\nfunc NonWWWRedirect() echo.MiddlewareFunc\n```\nNonWWWRedirect redirects www requests to non www. For example, [http://www.labstack.com](http://www.labstack.com) will be redirect to [http://labstack.com](http://labstack.com).\n\nUsage \\`Echo#Pre(NonWWWRedirect())\\`\n\n```go\nfunc NonWWWRedirectWithConfig(config RedirectConfig) echo.MiddlewareFunc\n```\nNonWWWRedirectWithConfig returns an HTTPSRedirect middleware with config. See \\`NonWWWRedirect()\\`.\n\n```go\nfunc Recover() echo.MiddlewareFunc\n```\nRecover returns a middleware which recovers from panics anywhere in the chain and handles the control to the centralized HTTPErrorHandler.\n\n```go\nfunc RecoverWithConfig(config RecoverConfig) echo.MiddlewareFunc\n```\nRecoverWithConfig returns a Recover middleware with config. See: \\`Recover()\\`.\n\n```go\nfunc RemoveTrailingSlash() echo.MiddlewareFunc\n```\nRemoveTrailingSlash returns a root level (before router) middleware which removes a trailing slash from the request URI.\n\nUsage \\`Echo#Pre(RemoveTrailingSlash())\\`\n\n```go\nfunc RemoveTrailingSlashWithConfig(config TrailingSlashConfig) echo.MiddlewareFunc\n```\nRemoveTrailingSlashWithConfig returns a RemoveTrailingSlash middleware with config. See \\`RemoveTrailingSlash()\\`.\n\n```go\nfunc Secure() echo.MiddlewareFunc\n```\nSecure returns a Secure middleware. Secure middleware provides protection against cross-site scripting (XSS) attack, content type sniffing, clickjacking, insecure connection and other code injection attacks.\n\n```go\nfunc SecureWithConfig(config SecureConfig) echo.MiddlewareFunc\n```\nSecureWithConfig returns a Secure middleware with config. See: \\`Secure()\\`.\n\n```go\nfunc WWWRedirect() echo.MiddlewareFunc\n```\nWWWRedirect redirects non www requests to www. For example, [http://labstack.com](http://labstack.com) will be redirect to [http://www.labstack.com](http://www.labstack.com).\n\nUsage \\`Echo#Pre(WWWRedirect())\\`\n\n```go\nfunc WWWRedirectWithConfig(config RedirectConfig) echo.MiddlewareFunc\n```\nWWWRedirectWithConfig returns an HTTPSRedirect middleware with config. See \\`WWWRedirect()\\`.\n\n## Types\n\n```go\ntype BasicAuthConfig struct {\n\t// Skipper defines a function to skip middleware.\n\tSkipper Skipper\n\n\t// Validator is a function to validate BasicAuth credentials.\n\t// Required.\n\tValidator BasicAuthValidator\n}\n```\nBasicAuthConfig defines the config for BasicAuth middleware.\n\n```go\ntype BasicAuthValidator func(string, string) bool\n```\nBasicAuthValidator defines a function to validate BasicAuth credentials.\n\n```go\ntype BodyLimitConfig struct {\n\t// Skipper defines a function to skip middleware.\n\tSkipper Skipper\n\n\t// Maximum allowed size for a request body, it can be specified\n\t// as `4x` or `4xB`, where x is one of the multiple from K, M, G, T or P.\n\tLimit string `json:\"limit\"`\n\t// contains filtered or unexported fields\n}\n```\nBodyLimitConfig defines the config for BodyLimit middleware.\n\n```go\ntype CORSConfig struct {\n\t// Skipper defines a function to skip middleware.\n\tSkipper Skipper\n\n\t// AllowOrigin defines a list of origins that may access the resource.\n\t// Optional. Default value []string{\"*\"}.\n\tAllowOrigins []string `json:\"allow_origins\"`\n\n\t// AllowMethods defines a list methods allowed when accessing the resource.\n\t// This is used in response to a preflight request.\n\t// Optional. Default value DefaultCORSConfig.AllowMethods.\n\tAllowMethods []string `json:\"allow_methods\"`\n\n\t// AllowHeaders defines a list of request headers that can be used when\n\t// making the actual request. This in response to a preflight request.\n\t// Optional. Default value []string{}.\n\tAllowHeaders []string `json:\"allow_headers\"`\n\n\t// AllowCredentials indicates whether or not the response to the request\n\t// can be exposed when the credentials flag is true. When used as part of\n\t// a response to a preflight request, this indicates whether or not the\n\t// actual request can be made using credentials.\n\t// Optional. Default value false.\n\tAllowCredentials bool `json:\"allow_credentials\"`\n\n\t// ExposeHeaders defines a whitelist headers that clients are allowed to\n\t// access.\n\t// Optional. Default value []string{}.\n\tExposeHeaders []string `json:\"expose_headers\"`\n\n\t// MaxAge indicates how long (in seconds) the results of a preflight request\n\t// can be cached.\n\t// Optional. Default value 0.\n\tMaxAge int `json:\"max_age\"`\n}\n```\nCORSConfig defines the config for CORS middleware.\n\n```go\ntype CSRFConfig struct {\n\t// Skipper defines a function to skip middleware.\n\tSkipper Skipper\n\n\t// TokenLength is the length of the generated token.\n\tTokenLength uint8 `json:\"token_length\"`\n\n\t// TokenLookup is a string in the form of \"\u003csource\u003e:\u003ckey\u003e\" that is used\n\t// to extract token from the request.\n\t// Optional. Default value \"header:X-CSRF-Token\".\n\t// Possible values:\n\t// - \"header:\u003cname\u003e\"\n\t// - \"form:\u003cname\u003e\"\n\t// - \"query:\u003cname\u003e\"\n\tTokenLookup string `json:\"token_lookup\"`\n\n\t// Context key to store generated CSRF token into context.\n\t// Optional. Default value \"csrf\".\n\tContextKey string `json:\"context_key\"`\n\n\t// Name of the CSRF cookie. This cookie will store CSRF token.\n\t// Optional. Default value \"csrf\".\n\tCookieName string `json:\"cookie_name\"`\n\n\t// Domain of the CSRF cookie.\n\t// Optional. Default value none.\n\tCookieDomain string `json:\"cookie_domain\"`\n\n\t// Path of the CSRF cookie.\n\t// Optional. Default value none.\n\tCookiePath string `json:\"cookie_path\"`\n\n\t// Max age (in seconds) of the CSRF cookie.\n\t// Optional. Default value 86400 (24hr).\n\tCookieMaxAge int `json:\"cookie_max_age\"`\n\n\t// Indicates if CSRF cookie is secure.\n\t// Optional. Default value false.\n\tCookieSecure bool `json:\"cookie_secure\"`\n\n\t// Indicates if CSRF cookie is HTTP only.\n\t// Optional. Default value false.\n\tCookieHTTPOnly bool `json:\"cookie_http_only\"`\n}\n```\nCSRFConfig defines the config for CSRF middleware.\n\n```go\ntype GzipConfig struct {\n\t// Skipper defines a function to skip middleware.\n\tSkipper Skipper\n\n\t// Gzip compression level.\n\t// Optional. Default value -1.\n\tLevel int `json:\"level\"`\n}\n```\nGzipConfig defines the config for Gzip middleware.\n\n```go\ntype JWTConfig struct {\n\t// Skipper defines a function to skip middleware.\n\tSkipper Skipper\n\n\t// Signing key to validate token.\n\t// Required.\n\tSigningKey interface{} `json:\"signing_key\"`\n\n\t// Signing method, used to check token signing method.\n\t// Optional. Default value HS256.\n\tSigningMethod string `json:\"signing_method\"`\n\n\t// Context key to store user information from the token into context.\n\t// Optional. Default value \"user\".\n\tContextKey string `json:\"context_key\"`\n\n\t// Claims are extendable claims data defining token content.\n\t// Optional. Default value jwt.MapClaims\n\tClaims jwt.Claims\n\n\t// TokenLookup is a string in the form of \"\u003csource\u003e:\u003cname\u003e\" that is used\n\t// to extract token from the request.\n\t// Optional. Default value \"header:Authorization\".\n\t// Possible values:\n\t// - \"header:\u003cname\u003e\"\n\t// - \"query:\u003cname\u003e\"\n\t// - \"cookie:\u003cname\u003e\"\n\tTokenLookup string `json:\"token_lookup\"`\n\t// contains filtered or unexported fields\n}\n```\nJWTConfig defines the config for JWT middleware.\n\n```go\ntype LoggerConfig struct {\n\t// Skipper defines a function to skip middleware.\n\tSkipper Skipper\n\n\t// Log format which can be constructed using the following tags:\n\t//\n\t// - time_rfc3339\n\t// - id (Request ID - Not implemented)\n\t// - remote_ip\n\t// - uri\n\t// - host\n\t// - method\n\t// - path\n\t// - referer\n\t// - user_agent\n\t// - status\n\t// - latency (In microseconds)\n\t// - latency_human (Human readable)\n\t// - bytes_in (Bytes received)\n\t// - bytes_out (Bytes sent)\n\t// - header:\u003cname\u003e\n\t// - query:\u003cname\u003e\n\t// - form:\u003cname\u003e\n\t//\n\t// Example \"${remote_ip} ${status}\"\n\t//\n\t// Optional. Default value DefaultLoggerConfig.Format.\n\tFormat string `json:\"format\"`\n\n\t// Output is a writer where logs are written.\n\t// Optional. Default value os.Stdout.\n\tOutput io.Writer\n\t// contains filtered or unexported fields\n}\n```\nLoggerConfig defines the config for Logger middleware.\n\n```go\ntype MethodOverrideConfig struct {\n\t// Skipper defines a function to skip middleware.\n\tSkipper Skipper\n\n\t// Getter is a function that gets overridden method from the request.\n\t// Optional. Default values MethodFromHeader(echo.HeaderXHTTPMethodOverride).\n\tGetter MethodOverrideGetter\n}\n```\nMethodOverrideConfig defines the config for MethodOverride middleware.\n\n```go\ntype MethodOverrideGetter func(echo.Context) string\n```\nMethodOverrideGetter is a function that gets overridden method from the request\n\n```go\nfunc MethodFromForm(param string) MethodOverrideGetter\n```\nMethodFromForm is a \\`MethodOverrideGetter\\` that gets overridden method from the form parameter.\n\n```go\nfunc MethodFromHeader(header string) MethodOverrideGetter\n```\nMethodFromHeader is a \\`MethodOverrideGetter\\` that gets overridden method from the request header.\n\n```go\nfunc MethodFromQuery(param string) MethodOverrideGetter\n```\nMethodFromQuery is a \\`MethodOverrideGetter\\` that gets overridden method from the query parameter.\n\n```go\ntype RecoverConfig struct {\n\t// Skipper defines a function to skip middleware.\n\tSkipper Skipper\n\n\t// Size of the stack to be printed.\n\t// Optional. Default value 4KB.\n\tStackSize int `json:\"stack_size\"`\n\n\t// DisableStackAll disables formatting stack traces of all other goroutines\n\t// into buffer after the trace for the current goroutine.\n\t// Optional. Default value false.\n\tDisableStackAll bool `json:\"disable_stack_all\"`\n\n\t// DisablePrintStack disables printing stack trace.\n\t// Optional. Default value as false.\n\tDisablePrintStack bool `json:\"disable_print_stack\"`\n}\n```\nRecoverConfig defines the config for Recover middleware.\n\n```go\ntype RedirectConfig struct {\n\t// Skipper defines a function to skip middleware.\n\tSkipper Skipper\n\n\t// Status code to be used when redirecting the request.\n\t// Optional. Default value http.StatusMovedPermanently.\n\tCode int `json:\"code\"`\n}\n```\nRedirectConfig defines the config for Redirect middleware.\n\n```go\ntype SecureConfig struct {\n\t// Skipper defines a function to skip middleware.\n\tSkipper Skipper\n\n\t// XSSProtection provides protection against cross-site scripting attack (XSS)\n\t// by setting the `X-XSS-Protection` header.\n\t// Optional. Default value \"1; mode=block\".\n\tXSSProtection string `json:\"xss_protection\"`\n\n\t// ContentTypeNosniff provides protection against overriding Content-Type\n\t// header by setting the `X-Content-Type-Options` header.\n\t// Optional. Default value \"nosniff\".\n\tContentTypeNosniff string `json:\"content_type_nosniff\"`\n\n\t// XFrameOptions can be used to indicate whether or not a browser should\n\t// be allowed to render a page in a \u003cframe\u003e, \u003ciframe\u003e or \u003cobject\u003e .\n\t// Sites can use this to avoid clickjacking attacks, by ensuring that their\n\t// content is not embedded into other sites.provides protection against\n\t// clickjacking.\n\t// Optional. Default value \"SAMEORIGIN\".\n\t// Possible values:\n\t// - \"SAMEORIGIN\" - The page can only be displayed in a frame on the same origin as the page itself.\n\t// - \"DENY\" - The page cannot be displayed in a frame, regardless of the site attempting to do so.\n\t// - \"ALLOW-FROM uri\" - The page can only be displayed in a frame on the specified origin.\n\tXFrameOptions string `json:\"x_frame_options\"`\n\n\t// HSTSMaxAge sets the `Strict-Transport-Security` header to indicate how\n\t// long (in seconds) browsers should remember that this site is only to\n\t// be accessed using HTTPS. This reduces your exposure to some SSL-stripping\n\t// man-in-the-middle (MITM) attacks.\n\t// Optional. Default value 0.\n\tHSTSMaxAge int `json:\"hsts_max_age\"`\n\n\t// HSTSExcludeSubdomains won't include subdomains tag in the `Strict Transport Security`\n\t// header, excluding all subdomains from security policy. It has no effect\n\t// unless HSTSMaxAge is set to a non-zero value.\n\t// Optional. Default value false.\n\tHSTSExcludeSubdomains bool `json:\"hsts_exclude_subdomains\"`\n\n\t// ContentSecurityPolicy sets the `Content-Security-Policy` header providing\n\t// security against cross-site scripting (XSS), clickjacking and other code\n\t// injection attacks resulting from execution of malicious content in the\n\t// trusted web page context.\n\t// Optional. Default value \"\".\n\tContentSecurityPolicy string `json:\"content_security_policy\"`\n}\n```\nSecureConfig defines the config for Secure middleware.\n\n```go\ntype Skipper func(c echo.Context) bool\n```\nSkipper defines a function to skip middleware. Returning true skips processing the middleware.\n\n```go\ntype TrailingSlashConfig struct {\n\t// Skipper defines a function to skip middleware.\n\tSkipper Skipper\n\n\t// Status code to be used when redirecting the request.\n\t// Optional, but when provided the request is redirected using this code.\n\tRedirectCode int `json:\"redirect_code\"`\n}\n```\nTrailingSlashConfig defines the config for TrailingSlash middleware.\n\n","path":"github.com/Code-Hex/echo/middleware","name":"middleware","synopsis":"","isRedistributable":true}
