File tree Expand file tree Collapse file tree 3 files changed +4
-8
lines changed Expand file tree Collapse file tree 3 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -107,11 +107,7 @@ func TestCors(t *testing.T) {
107
107
// OPTIONS should echo back the request method and headers (if there
108
108
// is an origin header set) and we should never get to our handler as
109
109
// the middleware short-circuits with a 200.
110
- if method == http .MethodOptions && test .origin == "" {
111
- require .Equal (t , "" , rw .Header ().Get (httpmw .AccessControlAllowMethodsHeader ))
112
- require .Equal (t , "" , rw .Header ().Get (httpmw .AccessControlAllowHeadersHeader ))
113
- require .Equal (t , http .StatusOK , rw .Code )
114
- } else if method == http .MethodOptions {
110
+ if method == http .MethodOptions && test .origin != "" {
115
111
require .Equal (t , http .MethodGet , rw .Header ().Get (httpmw .AccessControlAllowMethodsHeader ))
116
112
require .Equal (t , test .allowedHeaders , rw .Header ().Get (httpmw .AccessControlAllowHeadersHeader ))
117
113
require .Equal (t , http .StatusOK , rw .Code )
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ go 1.24.0
5
5
require (
6
6
cdr.dev/slog v1.6.1
7
7
github.com/go-chi/chi/v5 v5.2.3
8
- github.com/go-chi/cors v1.2.1
8
+ github.com/go-chi/cors v1.2.2
9
9
github.com/go-chi/httprate v0.15.0
10
10
github.com/google/uuid v1.6.0
11
11
github.com/lithammer/fuzzysearch v1.1.8
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
18
18
github.com/davecgh/go-spew v1.1.1 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
19
19
github.com/go-chi/chi/v5 v5.2.3 h1:WQIt9uxdsAbgIYgid+BpYc+liqQZGMHRaUwp0JUcvdE =
20
20
github.com/go-chi/chi/v5 v5.2.3 /go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops =
21
- github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4 =
22
- github.com/go-chi/cors v1.2.1 /go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58 =
21
+ github.com/go-chi/cors v1.2.2 h1:Jmey33TE+b+rB7fT8MUy1u0I4L+NARQlK6LhzKPSyQE =
22
+ github.com/go-chi/cors v1.2.2 /go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58 =
23
23
github.com/go-chi/httprate v0.15.0 h1:j54xcWV9KGmPf/X4H32/aTH+wBlrvxL7P+SdnRqxh5g =
24
24
github.com/go-chi/httprate v0.15.0 /go.mod h1:rzGHhVrsBn3IMLYDOZQsSU4fJNWcjui4fWKJcCId1R4 =
25
25
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ =
You can’t perform that action at this time.
0 commit comments