File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Expand file tree Collapse file tree 1 file changed +1
-5
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 )
You can’t perform that action at this time.
0 commit comments