catberry
Version:
Catberry is an isomorphic framework for building universal front-end apps using components, Flux architecture and progressive rendering.
25 lines (19 loc) • 389 B
JavaScript
;
const stream = require('stream');
class HttpResponse extends stream.PassThrough {
constructor() {
super();
this.headers = {};
this.code = -1;
}
writeHead(code, headers) {
this.code = code;
for (const name in headers) {
if (!headers.hasOwnProperty(name)) {
continue;
}
this.headers[name] = headers[name];
}
}
}
module.exports = HttpResponse;