mirror of
https://github.com/labstack/echo.git
synced 2025-01-12 01:22:21 +02:00
Updated readme
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
parent
96824ff627
commit
bca2fd450e
@ -242,6 +242,7 @@ Middleware | Description
|
|||||||
[Static](https://labstack.com/echo/guide/static-files#using-static-middleware:123f9d1043075fe4874616541b409e4d) | Serve static files
|
[Static](https://labstack.com/echo/guide/static-files#using-static-middleware:123f9d1043075fe4874616541b409e4d) | Serve static files
|
||||||
[AddTrailingSlash](https://labstack.com/echo/guide/middleware#addtrailingslash-middleware:37ab2f15ff048f67959bcac0a6032f32) | Add trailing slash to the request URI
|
[AddTrailingSlash](https://labstack.com/echo/guide/middleware#addtrailingslash-middleware:37ab2f15ff048f67959bcac0a6032f32) | Add trailing slash to the request URI
|
||||||
[RemoveTrailingSlash](https://labstack.com/echo/guide/middleware#removetrailingslash-middleware:37ab2f15ff048f67959bcac0a6032f32) | Remove trailing slash from the request URI
|
[RemoveTrailingSlash](https://labstack.com/echo/guide/middleware#removetrailingslash-middleware:37ab2f15ff048f67959bcac0a6032f32) | Remove trailing slash from the request URI
|
||||||
|
[MethodOverride](https://labstack.com/echo/guide/middleware#method-override-middleware:37ab2f15ff048f67959bcac0a6032f32) | Override request method
|
||||||
|
|
||||||
##### [More...](https://labstack.com/echo/guide/middleware)
|
##### [More...](https://labstack.com/echo/guide/middleware)
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ type (
|
|||||||
// Optional, with default value as `user`.
|
// Optional, with default value as `user`.
|
||||||
ContextKey string
|
ContextKey string
|
||||||
|
|
||||||
// Extractor is a function that extracts token from the request
|
// Extractor is a function that extracts token from the request.
|
||||||
// Optional, with default values as `JWTFromHeader`.
|
// Optional, with default values as `JWTFromHeader`.
|
||||||
Extractor JWTExtractor
|
Extractor JWTExtractor
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import (
|
|||||||
type (
|
type (
|
||||||
// MethodOverrideConfig defines the config for method override middleware.
|
// MethodOverrideConfig defines the config for method override middleware.
|
||||||
MethodOverrideConfig struct {
|
MethodOverrideConfig struct {
|
||||||
|
// Getter is a function that gets overridden method from the request.
|
||||||
Getter MethodOverrideGetter
|
Getter MethodOverrideGetter
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,10 +24,10 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// MethodOverride returns a method override middleware.
|
// MethodOverride returns a method override middleware.
|
||||||
// Method override middleware checks for the overriden method from the request and
|
// Method override middleware checks for the overridden method from the request and
|
||||||
// uses it instead of the original method.
|
// uses it instead of the original method.
|
||||||
//
|
//
|
||||||
// For security reasons, only `POST` method can be overriden.
|
// For security reasons, only `POST` method can be overridden.
|
||||||
func MethodOverride() echo.MiddlewareFunc {
|
func MethodOverride() echo.MiddlewareFunc {
|
||||||
return MethodOverrideWithConfig(DefaultMethodOverrideConfig)
|
return MethodOverrideWithConfig(DefaultMethodOverrideConfig)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user