Write the http.StatusOK header in the OPTIONS
handler and update the unit tests to refer to the
response code using the const from the http package.
... | ... |
@@ -1260,7 +1260,7 @@ func TestOptionsRoute(t *testing.T) { |
1260 | 1260 |
} |
1261 | 1261 |
|
1262 | 1262 |
router.ServeHTTP(r, req) |
1263 |
- if r.Code != 200 { |
|
1263 |
+ if r.Code != http.StatusOK { |
|
1264 | 1264 |
t.Errorf("Expected response for OPTIONS request to be \"200\", %v found.", r.Code) |
1265 | 1265 |
} |
1266 | 1266 |
} |
... | ... |
@@ -1287,7 +1287,7 @@ func TestGetEnabledCors(t *testing.T) { |
1287 | 1287 |
} |
1288 | 1288 |
|
1289 | 1289 |
router.ServeHTTP(r, req) |
1290 |
- if r.Code != 200 { |
|
1290 |
+ if r.Code != http.StatusOK { |
|
1291 | 1291 |
t.Errorf("Expected response for OPTIONS request to be \"200\", %v found.", r.Code) |
1292 | 1292 |
} |
1293 | 1293 |
|