Skip to content

Commit

Permalink
Fix tests after updating CORS library
Browse files Browse the repository at this point in the history
The cors library has changed behaviour.

Setting Access-Control-Allow-Origin to '*' will always return '*'.

See:

* Where change happened: rs/cors@8dd4211
* Current master: https://github.com/rs/cors/blob/a3460e445dd310dbefee993fe449f2ff9c08ae71/cors.go#L331
  • Loading branch information
hsanjuan committed Jan 10, 2019
1 parent f615779 commit 50a7669
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions http/reforigin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func TestWildcardOrigin(t *testing.T) {
Origin: origin,
AllowOrigins: allowedOrigins,
ResHeaders: map[string]string{
ACAOrigin: origin,
ACAOrigin: "*",
ACAMethods: "",
ACACredentials: "",
"Access-Control-Max-Age": "",
Expand Down Expand Up @@ -259,7 +259,7 @@ func TestWildcardReferer(t *testing.T) {
Origin: origin,
AllowOrigins: allowedOrigins,
ResHeaders: map[string]string{
ACAOrigin: origin,
ACAOrigin: "*",
ACAMethods: "",
ACACredentials: "",
"Access-Control-Max-Age": "",
Expand Down Expand Up @@ -289,7 +289,7 @@ func TestAllowedMethod(t *testing.T) {
gtc := func(method string, ok bool) httpTestCase {
code := http.StatusOK
hdrs := map[string]string{
ACAOrigin: "http://localhost",
ACAOrigin: "*",
ACAMethods: method,
ACACredentials: "",
"Access-Control-Max-Age": "",
Expand Down

0 comments on commit 50a7669

Please sign in to comment.