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) {
107107 // OPTIONS should echo back the request method and headers (if there
108108 // is an origin header set) and we should never get to our handler as
109109 // 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 != "" {
115111 require .Equal (t , http .MethodGet , rw .Header ().Get (httpmw .AccessControlAllowMethodsHeader ))
116112 require .Equal (t , test .allowedHeaders , rw .Header ().Get (httpmw .AccessControlAllowHeadersHeader ))
117113 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
55require (
66 cdr.dev/slog v1.6.1
77 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
99 github.com/go-chi/httprate v0.15.0
1010 github.com/google/uuid v1.6.0
1111 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
1818github.com/davecgh/go-spew v1.1.1 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
1919github.com/go-chi/chi/v5 v5.2.3 h1:WQIt9uxdsAbgIYgid+BpYc+liqQZGMHRaUwp0JUcvdE =
2020github.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 =
2323github.com/go-chi/httprate v0.15.0 h1:j54xcWV9KGmPf/X4H32/aTH+wBlrvxL7P+SdnRqxh5g =
2424github.com/go-chi/httprate v0.15.0 /go.mod h1:rzGHhVrsBn3IMLYDOZQsSU4fJNWcjui4fWKJcCId1R4 =
2525github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ =
You can’t perform that action at this time.
0 commit comments