flatiron/union — Issue #4: Not 100% Connect/Express-compatible
Author: jesusabdullah
Created: 2011-11-15 23:56:46+00:00
State: open

I tried to use connect's static provider, which *should've* Just Worked. However, it seems that the req and res objects between connect/express and flatiron are not 100% compatible.

Here's a reproducing test program:

```js
var union = require("union"),
express = require("express"),
static = express.static(__dirname + '/static');

union.createServer({
before: [
static
]
}).listen(8080);

express.createServer(static).listen(8081);

console.log("union: localhost:8080");
console.log("express: localhost:8081");
```

This program works fine for the express server, but for the union server:

```
josh@onix:/tmp/express-test$ node test.js
union: localhost:8080
express: localhost:8081

/tmp/express-test/node_modules/express/node_modules/connect/lib/middleware/static.js:162
if (!res.getHeader('Date')) res.setHeader('Date', new Date().toUTCString()
^
TypeError: Object [object Object] has no method 'getHeader'
at /tmp/express-test/node_modules/express/node_modules/connect/lib/middleware/static.js:162:14
josh@onix:/tmp/express-test$
```