cozy / cozy-data-system

Deprecated - Data Layer for Cozy V2 Platform
https://cozy.io
GNU Affero General Public License v3.0
24 stars 21 forks source link

Server crash: stream has no method setHeader #151

Closed clochix closed 9 years ago

clochix commented 9 years ago

Data system of a user's instance keep crashing, here are the logs:

/usr/local/cozy/apps/data-system/build/server/controllers/attachments.js:86
        stream.setHeader('range', req.headers['range']);
               ^
TypeError: Object #<IncomingMessage> has no method 'setHeader'
    at /usr/local/cozy/apps/data-system/build/server/controllers/attachments.js:86:16
    at callback (/usr/local/cozy/apps/data-system/build/server/lib/downloader.js:47:7)
    at ClientRequest.<anonymous> (/usr/local/cozy/apps/data-system/build/server/lib/downloader.js:81:20)
    at ClientRequest.g (events.js:180:16)
    at ClientRequest.emit (events.js:95:17)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1689:21)
    at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:122:23)
    at Socket.socketOnData [as ondata] (http.js:1584:20)
    at TCP.onread (net.js:528:27)
frankrousseau commented 9 years ago

Can you push the build and make a PR on the master branch?