TroyGoode/node-cors — pull request #11 by mafintosh (2013-10-14 15:03:01+00:00)
Title: Support for connect usage without express

First of all great module!

I recently had to use this in a non-express project that uses the connect middleware stack.
Currently this module depends on

* `request.header(...)`
* `response.header(...)`
* `response.send(...)`

Which are methods that are added by express which means it will not work using only connect.

This PR uses the standard node methods for accessing/setting headers

* `response.getHeader(name)` and `response.setHeader(name, value)`
* `request.headers[name]`
* `response.end()`

which mean it will work without express.

I had to update your mocks in your tests as well.