bare-http1 4.2.0 → 4.2.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.
package/index.js CHANGED
@@ -30,7 +30,7 @@ exports.request = function request(url, opts, onresponse) {
30
30
  if (typeof url === 'string') url = new URL(url)
31
31
 
32
32
  if (isURL(url)) {
33
- opts = opts ? { ...opts } : {}
33
+ opts = opts ? { ...url, ...opts } : { ...url }
34
34
 
35
35
  opts.host = url.hostname
36
36
  opts.path = url.pathname + url.search
@@ -34,7 +34,7 @@ module.exports = class HTTPServerResponse extends HTTPOutgoingMessage {
34
34
 
35
35
  this.statusCode = statusCode
36
36
  this.statusMessage = statusMessage || null
37
- this.headers = headers || {}
37
+ if (headers) this.headers = { ...this.headers, ...headers }
38
38
  }
39
39
 
40
40
  _header() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-http1",
3
- "version": "4.2.0",
3
+ "version": "4.2.2",
4
4
  "description": "Native HTTP/1 library for JavaScript",
5
5
  "exports": {
6
6
  "./package": "./package.json",