var fs        = require('fs');
var normalize = require("../lib/timings_normalize.js");
var validate  = require("../lib/timings_validate.js");

module.exports = function(app) {
    app.post("/", function(req, res) {
        var performance = req.body;

        if (validate(performance.timing)) {
            performance.timing = normalize(performance.timing);
            app.emit('data', {
                performance: performance,
                userAgent: req.headers["user-agent"],
                referer: req.headers.referer,
                remoteAddress: req.connection.remoteAddress
            });

            res.send(204);
        } else {
            res.send(400);
        }
    });
    app.options("/", function(req, res) {
        res.send();
    });

    app.get("/client.js", function(req, res) {
        fs.createReadStream(__dirname + "/../public/client.js").pipe(res);
    });
};

@@ -802,32 +802,94 @@
 ion(req, res) %7B%0A
+        res.header(%22Content-Type%22, %22application/javascript%22);%0A
         fs.creat

add content type header