File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 7
7
"encoding/xml"
8
8
"errors"
9
9
"fmt"
10
- "github.com/labstack/gommon/log"
11
10
"io"
12
11
"math"
13
12
"mime/multipart"
@@ -19,6 +18,7 @@ import (
19
18
"text/template"
20
19
"time"
21
20
21
+ "github.com/labstack/gommon/log"
22
22
testify "github.com/stretchr/testify/assert"
23
23
)
24
24
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ func TestCORS(t *testing.T) {
73
73
c = e .NewContext (req , rec )
74
74
req .Header .Set (echo .HeaderOrigin , "http://aaa.example.com" )
75
75
cors = CORSWithConfig (CORSConfig {
76
- AllowOrigins : []string {"http://*.example.com" },
76
+ AllowOrigins : []string {"http://*.example.com" },
77
77
})
78
78
h = cors (echo .NotFoundHandler )
79
79
h (c )
Original file line number Diff line number Diff line change 25
25
// ErrorHandler defines a function which is executed for an invalid token.
26
26
// It may be used to define a custom JWT error.
27
27
ErrorHandler JWTErrorHandler
28
-
28
+
29
29
// ErrorHandlerWithContext is almost identical to ErrorHandler, but it's passed the current context.
30
30
ErrorHandlerWithContext JWTErrorHandlerWithContext
31
31
74
74
75
75
// JWTErrorHandlerWithContext is almost identical to JWTErrorHandler, but it's passed the current context.
76
76
JWTErrorHandlerWithContext func (error , echo.Context ) error
77
-
77
+
78
78
jwtExtractor func (echo.Context ) (string , error )
79
79
)
80
80
@@ -183,7 +183,7 @@ func JWTWithConfig(config JWTConfig) echo.MiddlewareFunc {
183
183
if config .ErrorHandler != nil {
184
184
return config .ErrorHandler (err )
185
185
}
186
-
186
+
187
187
if config .ErrorHandlerWithContext != nil {
188
188
return config .ErrorHandlerWithContext (err , c )
189
189
}
@@ -210,7 +210,7 @@ func JWTWithConfig(config JWTConfig) echo.MiddlewareFunc {
210
210
return config .ErrorHandler (err )
211
211
}
212
212
if config .ErrorHandlerWithContext != nil {
213
- return config .ErrorHandlerWithContext (err , c )
213
+ return config .ErrorHandlerWithContext (err , c )
214
214
}
215
215
return & echo.HTTPError {
216
216
Code : http .StatusUnauthorized ,
Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ func TestJWT(t *testing.T) {
205
205
req .Header .Set (echo .HeaderCookie , tc .hdrCookie )
206
206
c := e .NewContext (req , res )
207
207
208
- if tc .reqURL == "/" + token {
208
+ if tc .reqURL == "/" + token {
209
209
c .SetParamNames ("jwt" )
210
210
c .SetParamValues (token )
211
211
}
You can’t perform that action at this time.
0 commit comments