Skip to content

Cannot set property 'cache-control' of undefined in io.js/v0.12 #2548

Closed
@halfdan

Description

@halfdan

Not exactly sure what is happening here but express.js is failing on io.js and v0.12 when used within Ghost: https://travis-ci.org/halfdan/Ghost/builds/50824137

TypeError: Cannot set property 'cache-control' of undefined
      at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:341:22)
      at ServerResponse.header (/home/travis/build/halfdan/Ghost/node_modules/express/lib/response.js:695:10)
      at ServerResponse.header (/home/travis/build/halfdan/Ghost/node_modules/express/lib/response.js:698:12)
      at Object.errors.error404 (/home/travis/build/halfdan/Ghost/core/server/errors/index.js:290:13)
      at Context.<anonymous> (/home/travis/build/halfdan/Ghost/core/test/unit/error_handling_spec.js:342:20)

Here's a piece of code that shows the issue:

var express = require('express');
var res = express.response;
res.set({'cache-header': 'foo'});

Above code works in v0.10 but not in v0.12. Express version is latest 4.11.2.

ref #2539, #2538

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions