GeezerVison is showing github.com — net: use decodeStrings public API for writable stream · nodejs/node@c13e5be
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/net.js +2-3Lines changed: 2 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -255,6 +255,8 @@ function Socket(options) { |
255 | 255 | options.allowHalfOpen = true; |
256 | 256 | // For backwards compat do not emit close on destroy. |
257 | 257 | options.emitClose = false; |
| 258 | + // Handle strings directly. |
| 259 | + options.decodeStrings = false; |
258 | 260 | stream.Duplex.call(this, options); |
259 | 261 |
|
260 | 262 | // Default to *not* allowing half open sockets. |
@@ -308,9 +310,6 @@ function Socket(options) { |
308 | 310 | this._pendingData = null; |
309 | 311 | this._pendingEncoding = ''; |
310 | 312 |
|
311 | | - // handle strings directly |
312 | | - this._writableState.decodeStrings = false; |
313 | | - |
314 | 313 | // If we have a handle, then start the flow of data into the |
315 | 314 | // buffer. if not, then this will happen when we connect |
316 | 315 | if (this._handle && options.readable !== false) { |
|