evert0n/koa-cors — pull request #19 by johngeorgewright (2014-11-06 14:55:16+00:00)
Title: Asynchronous origin finding

At the moment there's no handling for asynchronous operations within the `origin` finding.

```js
cors({
origin: function (request) {
// ... search through database or something just as fun
}
});
```

This pull request adds the opportunity to return anything that we can yield (promises etc).

```js
cors({
origin: function (request) {
return new Promise(function (resolve) {
// some asynchronous operation
resolve(something);
});
}
});
```