-
-
Notifications
You must be signed in to change notification settings - Fork 16.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot set property 'cache-control' of undefined in io.js/v0.12 #2548
Comments
|
Hi! This is not an express bug, but simple a change between 0.10 and 0.12. As such, you must construct a new instance of the class to actually call methods on it. You should have been As for that This what you're doing, reduced down to Node.js core only. You can see it "works" in 0.10 (but of course, pollutes the global http response prototype), but not 0.12: var http = require('http');
var res = http.ServerResponse;
res.setHeader('cache-header', 'foo'); |
TL;DR, your test mocking was just fragile enough to notice a change in Node.js core. I recommend not using mocking. |
Um, |
If you try to do
|
This is a really old thread from many months ago. The proper solution is the following:
|
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
Here's a piece of code that shows the issue:
Above code works in v0.10 but not in v0.12. Express version is latest 4.11.2.
ref #2539, #2538
The text was updated successfully, but these errors were encountered: