Skip to content

Commit

Permalink
http: simplify if statement
Browse files Browse the repository at this point in the history
PR-URL: #13857
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
BridgeAR authored and tniessen committed Jun 28, 2017
1 parent b3e5c46 commit 2fa2a60
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,8 @@ function writeHead(statusCode, reason, obj) {
if (k) this.setHeader(k, obj[k]);
}
}
if (k === undefined) {
if (this._header) {
throw new errors.Error('ERR_HTTP_HEADERS_SENT');
}
if (k === undefined && this._header) {
throw new errors.Error('ERR_HTTP_HEADERS_SENT');
}
// only progressive api is used
headers = this[outHeadersKey];
Expand Down

0 comments on commit 2fa2a60

Please sign in to comment.