Skip to content

Conversation

@tsukune-ch
Copy link

The current CORS curl demo will not return a response containing CORS headers.
I think it would be better to add a curl demo that returns a response containing that.

$ curl -i http://127.0.0.1:8080/countries
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-Powered-By: go-json-rest
Date: Mon, 04 Dec 2017 18:18:01 GMT
Content-Length: 105

[
  {
    "Code": "FR",
    "Name": "France"
  },
  {
    "Code": "US",
    "Name": "United States"
  }
]
$ curl -H "Origin: http://my.other.host" -i http://127.0.0.1:8080/countries
HTTP/1.1 200 OK
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: http://my.other.host
Content-Type: application/json; charset=utf-8
X-Powered-By: go-json-rest
Date: Mon, 04 Dec 2017 18:18:21 GMT
Content-Length: 105

[
  {
    "Code": "FR",
    "Name": "France"
  },
  {
    "Code": "US",
    "Name": "United States"
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant