http: simplify if statement
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
b3e5c4621d
commit
2fa2a60721
@ -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];
|
||||
|
Loading…
x
Reference in New Issue
Block a user