chrisdickinson/sse-stream — pull request #2 by davidmarkclements (2014-08-17 00:30:32+00:00)
Title: adding cors support (and tiny bugfix)

cors support:
configure cors headers with require('sse-stream')({ path: '/sse', cors: {
origin: 'someaddress.com'
credentials: true
}})

see https://www.npmjs.org/package/access-control for full list options, default options
are as liberal as possible, e.g. require('sse-stream')('/') will set cors options to
{origin: '*', credentials: false}

There's no object extending, if a cors config object is supplied it overwrites the default
object, in keeping with the approach for the options object.

the bug fix:
data coming through write method is a buffer,
buffers (v0.10.30) don't have a split method, so process crashes,
so we stringify the data as it's coming through.