deep-framework
Version:
20 lines (16 loc) • 484 B
JavaScript
var _ = require('underscore');
/**
* Represents a downstream AWS HTTP/HTTPS call.
* @constructor
* @param {http.IncomingMessage} res - The response object from the HTTP/HTTPS call.
*/
function Downstream(res) {
this.init(res);
}
Downstream.prototype.init = function init(res) {
this.response = {
status: res.httpResponse.statusCode || '',
content_length: _.has(res.headers, 'content-length') ? res.headers['content-length'] : 0
};
};
module.exports = Downstream;