Skip to content

Commit 3d1c835

Browse files
committed
error handling
1 parent 0e37a27 commit 3d1c835

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

handler.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ func echoHandler(w http.ResponseWriter, req *http.Request) {
2828
var authzInfo = map[string]any{}
2929
{
3030
authzHeader := req.Header.Get("Authorization")
31+
if len(authzHeader) <= 7 {
32+
// empty or not have bearer token
33+
goto breakAuthz
34+
}
3135

3236
// JWT
3337
jwtInfo := map[string]any{}

0 commit comments

Comments
 (0)