bare-http1 3.5.1 → 3.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,7 +56,7 @@ module.exports = class HTTPClientRequest extends HTTPOutgoingMessage {
56
56
  return h
57
57
  }
58
58
 
59
- _write (data, cb) {
59
+ _write (data, encoding, cb) {
60
60
  if (this.headersSent === false) this.flushHeaders()
61
61
 
62
62
  if (this._chunked) {
@@ -3,7 +3,7 @@ const errors = require('./errors')
3
3
 
4
4
  module.exports = class HTTPOutgoingMessage extends Writable {
5
5
  constructor (socket) {
6
- super({ mapWritable })
6
+ super()
7
7
 
8
8
  this.socket = socket
9
9
  this.headers = {}
@@ -42,7 +42,3 @@ module.exports = class HTTPOutgoingMessage extends Writable {
42
42
  if (this.upgrade === false) this.socket.destroy()
43
43
  }
44
44
  }
45
-
46
- function mapWritable (data) {
47
- return typeof data === 'string' ? Buffer.from(data) : data
48
- }
@@ -54,7 +54,7 @@ module.exports = class HTTPServerResponse extends HTTPOutgoingMessage {
54
54
  return h
55
55
  }
56
56
 
57
- _write (data, cb) {
57
+ _write (data, encoding, cb) {
58
58
  if (this.headersSent === false) {
59
59
  if (this._finishing) {
60
60
  this.setHeader('Content-Length', (data.byteLength + this._writableState.buffered).toString())
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-http1",
3
- "version": "3.5.1",
3
+ "version": "3.5.2",
4
4
  "description": "Native HTTP/1 library for JavaScript",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -26,7 +26,7 @@
26
26
  "homepage": "https://github.com/holepunchto/bare-http1#readme",
27
27
  "dependencies": {
28
28
  "bare-events": "^2.0.0",
29
- "bare-stream": "^1.0.0",
29
+ "bare-stream": "^2.0.0",
30
30
  "bare-tcp": "^1.1.2"
31
31
  },
32
32
  "devDependencies": {