Skip to content

Commit

Permalink
Check that only our default is the response status code.
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Ortiz <[email protected]>
  • Loading branch information
taik0 committed Jul 11, 2024
1 parent 8150939 commit 85562b7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gin/cors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ func TestNew(t *testing.T) {
req.Header.Add("Access-Control-Request-Method", "GET")
req.Header.Add("Access-Control-Request-Headers", "origin")
e.ServeHTTP(res, req)
if res.Code != 200 && res.Code != 204 {
t.Errorf("Invalid status code: %d should be 200 or 204", res.Code)
if res.Code != 200 {
t.Errorf("Invalid status code: %d should be 200", res.Code)
}

assertHeaders(t, res.Header(), map[string]string{
Expand Down Expand Up @@ -75,8 +75,8 @@ func TestAllowOriginWildcard(t *testing.T) {
req.Header.Add("Access-Control-Request-Method", "GET")
req.Header.Add("Access-Control-Request-Headers", "origin")
e.ServeHTTP(res, req)
if res.Code != 200 && res.Code != 204 {
t.Errorf("Invalid status code: %d should be 200 or 204", res.Code)
if res.Code != 200 {
t.Errorf("Invalid status code: %d should be 200", res.Code)
}

assertHeaders(t, res.Header(), map[string]string{
Expand Down Expand Up @@ -107,8 +107,8 @@ func TestAllowOriginEmpty(t *testing.T) {
req.Header.Add("Access-Control-Request-Method", "GET")
req.Header.Add("Access-Control-Request-Headers", "origin")
e.ServeHTTP(res, req)
if res.Code != 200 && res.Code != 204 {
t.Errorf("Invalid status code: %d should be 200 or 204", res.Code)
if res.Code != 200 {
t.Errorf("Invalid status code: %d should be 200", res.Code)
}

assertHeaders(t, res.Header(), map[string]string{
Expand Down

0 comments on commit 85562b7

Please sign in to comment.