Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
http: remove unused code block
Browse files Browse the repository at this point in the history
fix #7769

Signed-off-by: Fedor Indutny <fedor@indutny.com>
  • Loading branch information
indutny committed Jun 27, 2014
1 parent 6b09f9c commit 73343d5
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,30 +187,15 @@ ServerResponse.prototype.writeHead = function(statusCode) {

var obj = arguments[headerIndex];

if (obj && this._headers) {
if (util.isArray(obj)) {
// handle array case
// TODO: remove when array is no longer accepted
var field;
for (var i = 0, len = obj.length; i < len; ++i) {
field = obj[i][0];
if (!util.isUndefined(headers[field])) {
obj.push([field, headers[field]]);
}
}
headers = obj;

} else {
// handle object case
if (this._headers) {
// Slow-case: when progressive API and header fields are passed.
if (obj) {
var keys = Object.keys(obj);
for (var i = 0; i < keys.length; i++) {
var k = keys[i];
if (k) this.setHeader(k, obj[k]);
}
// Slow-case: when progressive API and header fields are passed.
headers = this._renderHeaders();
}
} else if (this._headers) {
// only progressive api is used
headers = this._renderHeaders();
} else {
Expand Down

0 comments on commit 73343d5

Please sign in to comment.