Kit Sunde Kit Sunde - 1 year ago 127
Javascript Question

Why isn't express-js setting the Content-Type header?

I have the following:

var express = require('express'),
app = express.createServer();

app.get("/offline.manifest", function(req, res){
res.end("CACHE MANIFEST");


The network tab in Chrome says it's
. Why isn't it setting the header?

The code above works, my problems were caused by a linking to an old version of express-js

Answer Source

res.type('json') works too now

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download