balderdashy/sails — pull request #961 by bmaland (2013-10-08 12:27:18+00:00)
Title: Don't set CORS headers if the Origin header is missing from the request

Current behaviour is broken:

```bash
$ curl -i http://localhost:1337/test
```

```http
HTTP/1.1 200 OK
X-Powered-By: Sails
Access-Control-Allow-Origin: undefined
Access-Control-Allow-Credentials: true
```

After this change the CORS headers are only added if Origin is present in the request. This is similar to e.g. `rack-cors`.