mirror of
https://github.com/labstack/echo.git
synced 2025-01-12 01:22:21 +02:00
format code (gofmt + trim trailing space) (#1452)
This commit is contained in:
parent
8d7f05e533
commit
712b5e46c5
@ -7,7 +7,6 @@ import (
|
||||
"encoding/xml"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/labstack/gommon/log"
|
||||
"io"
|
||||
"math"
|
||||
"mime/multipart"
|
||||
@ -19,6 +18,7 @@ import (
|
||||
"text/template"
|
||||
"time"
|
||||
|
||||
"github.com/labstack/gommon/log"
|
||||
testify "github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
@ -73,7 +73,7 @@ func TestCORS(t *testing.T) {
|
||||
c = e.NewContext(req, rec)
|
||||
req.Header.Set(echo.HeaderOrigin, "http://aaa.example.com")
|
||||
cors = CORSWithConfig(CORSConfig{
|
||||
AllowOrigins: []string{"http://*.example.com"},
|
||||
AllowOrigins: []string{"http://*.example.com"},
|
||||
})
|
||||
h = cors(echo.NotFoundHandler)
|
||||
h(c)
|
||||
|
@ -25,7 +25,7 @@ type (
|
||||
// ErrorHandler defines a function which is executed for an invalid token.
|
||||
// It may be used to define a custom JWT error.
|
||||
ErrorHandler JWTErrorHandler
|
||||
|
||||
|
||||
// ErrorHandlerWithContext is almost identical to ErrorHandler, but it's passed the current context.
|
||||
ErrorHandlerWithContext JWTErrorHandlerWithContext
|
||||
|
||||
@ -74,7 +74,7 @@ type (
|
||||
|
||||
// JWTErrorHandlerWithContext is almost identical to JWTErrorHandler, but it's passed the current context.
|
||||
JWTErrorHandlerWithContext func(error, echo.Context) error
|
||||
|
||||
|
||||
jwtExtractor func(echo.Context) (string, error)
|
||||
)
|
||||
|
||||
@ -183,7 +183,7 @@ func JWTWithConfig(config JWTConfig) echo.MiddlewareFunc {
|
||||
if config.ErrorHandler != nil {
|
||||
return config.ErrorHandler(err)
|
||||
}
|
||||
|
||||
|
||||
if config.ErrorHandlerWithContext != nil {
|
||||
return config.ErrorHandlerWithContext(err, c)
|
||||
}
|
||||
@ -210,7 +210,7 @@ func JWTWithConfig(config JWTConfig) echo.MiddlewareFunc {
|
||||
return config.ErrorHandler(err)
|
||||
}
|
||||
if config.ErrorHandlerWithContext != nil {
|
||||
return config.ErrorHandlerWithContext(err, c)
|
||||
return config.ErrorHandlerWithContext(err, c)
|
||||
}
|
||||
return &echo.HTTPError{
|
||||
Code: http.StatusUnauthorized,
|
||||
|
@ -205,7 +205,7 @@ func TestJWT(t *testing.T) {
|
||||
req.Header.Set(echo.HeaderCookie, tc.hdrCookie)
|
||||
c := e.NewContext(req, res)
|
||||
|
||||
if tc.reqURL == "/" + token {
|
||||
if tc.reqURL == "/"+token {
|
||||
c.SetParamNames("jwt")
|
||||
c.SetParamValues(token)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user