(statusCode, reason, obj)
| 63 | } |
| 64 | |
| 65 | writeHead(statusCode, reason, obj) { |
| 66 | const headers = typeof reason === 'string' |
| 67 | ? obj |
| 68 | : reason |
| 69 | |
| 70 | for (const name in headers) { |
| 71 | this.setHeader(name, headers[name]) |
| 72 | |
| 73 | if (!this._wroteHeader) { |
| 74 | // we only need to initiate super.headers once |
| 75 | // writeHead will add the other headers itself |
| 76 | break |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | super.writeHead(statusCode, reason, obj); |
| 81 | } |
| 82 | |
| 83 | constructor({ method }) { |
| 84 | super({ method }); |
no test coverage detected