| 7094 | } |
| 7095 | if (bytesWritten === 0) { |
| 7096 | if (expectsPayload) { |
| 7097 | socket.write(`${header}content-length: 0\r |
| 7098 | \r |
| 7099 | `, "latin1"); |
| 7100 | } else { |
| 7101 | socket.write(`${header}\r |
| 7102 | `, "latin1"); |
| 7103 | } |
| 7104 | } else if (contentLength === null) { |
| 7105 | socket.write("\r\n0\r\n\r\n", "latin1"); |
| 7106 | } |
| 7107 | if (contentLength !== null && bytesWritten !== contentLength) { |
| 7108 | if (client[kStrictContentLength]) { |
| 7109 | throw new RequestContentLengthMismatchError(); |
| 7110 | } else { |
| 7111 | process.emitWarning(new RequestContentLengthMismatchError()); |