Skip to content

Commit 12cc543

Browse files
committed
fix: skip malformed origins
1 parent 01d802a commit 12cc543

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

x/oauth2cors/cors.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ func Middleware(
4949
}
5050
g, err := glob.Compile(strings.ToLower(o), '.')
5151
if err != nil {
52-
reg.Logger().WithError(err).WithField("pattern", o).Error("Unable to parse CORS origin")
53-
h.ServeHTTP(w, r)
54-
return
52+
reg.Logger().WithError(err).WithField("pattern", o).Error("Unable to parse CORS origin, ignoring it")
53+
continue
5554
}
5655

5756
patterns = append(patterns, g)

0 commit comments

Comments
 (0)