Update module labstack/echo/v4 to v4.1.16 (#241)
Update module labstack/echo/v4 to v4.1.16 Reviewed-on: https://kolaente.dev/vikunja/api/pulls/241
This commit is contained in:
16
vendor/github.com/labstack/echo/v4/context.go
generated
vendored
16
vendor/github.com/labstack/echo/v4/context.go
generated
vendored
@ -43,6 +43,7 @@ type (
|
||||
|
||||
// RealIP returns the client's network address based on `X-Forwarded-For`
|
||||
// or `X-Real-IP` request header.
|
||||
// The behavior can be configured using `Echo#IPExtractor`.
|
||||
RealIP() string
|
||||
|
||||
// Path returns the registered path for the handler.
|
||||
@ -270,6 +271,10 @@ func (c *context) Scheme() string {
|
||||
}
|
||||
|
||||
func (c *context) RealIP() string {
|
||||
if c.echo != nil && c.echo.IPExtractor != nil {
|
||||
return c.echo.IPExtractor(c.request)
|
||||
}
|
||||
// Fall back to legacy behavior
|
||||
if ip := c.request.Header.Get(HeaderXForwardedFor); ip != "" {
|
||||
return strings.Split(ip, ", ")[0]
|
||||
}
|
||||
@ -305,6 +310,7 @@ func (c *context) ParamNames() []string {
|
||||
|
||||
func (c *context) SetParamNames(names ...string) {
|
||||
c.pnames = names
|
||||
*c.echo.maxParam = len(names)
|
||||
}
|
||||
|
||||
func (c *context) ParamValues() []string {
|
||||
@ -312,10 +318,7 @@ func (c *context) ParamValues() []string {
|
||||
}
|
||||
|
||||
func (c *context) SetParamValues(values ...string) {
|
||||
// NOTE: Don't just set c.pvalues = values, because it has to have length c.echo.maxParam at all times
|
||||
for i, val := range values {
|
||||
c.pvalues[i] = val
|
||||
}
|
||||
c.pvalues = values
|
||||
}
|
||||
|
||||
func (c *context) QueryParam(name string) string {
|
||||
@ -355,8 +358,11 @@ func (c *context) FormParams() (url.Values, error) {
|
||||
|
||||
func (c *context) FormFile(name string) (*multipart.FileHeader, error) {
|
||||
f, fh, err := c.request.FormFile(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer f.Close()
|
||||
return fh, err
|
||||
return fh, nil
|
||||
}
|
||||
|
||||
func (c *context) MultipartForm() (*multipart.Form, error) {
|
||||
|
Reference in New Issue
Block a user