Socket
Socket
Sign inDemoInstall

minipass-fetch

Package Overview
Dependencies
8
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.2 to 1.2.0

6

lib/body.js

@@ -296,2 +296,8 @@ 'use strict'

if (!res) {
res = /<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(str)
if (res)
res.pop() // drop last quote
}
if (res)

@@ -298,0 +304,0 @@ res = /charset=(.*)/i.exec(res.pop())

2

lib/headers.js

@@ -5,3 +5,2 @@ 'use strict'

const validateName = name => {

@@ -138,3 +137,2 @@ name = `${name}`

keys () {

@@ -141,0 +139,0 @@ return new HeadersIterator(this, 'key')

@@ -119,3 +119,3 @@ 'use strict'

case 'error':
reject(new FetchError(`redirect mode is set to error: ${
reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${
request.url}`, 'no-redirect'))

@@ -155,2 +155,14 @@ finalize()

// HTTP-redirect fetch step 9
if (res.statusCode !== 303 &&
request.body &&
getTotalBytes(request) === null) {
reject(new FetchError(
'Cannot follow redirect with body being a readable stream',
'unsupported-redirect'
))
finalize()
return
}
// HTTP-redirect fetch step 6 (counter increment)

@@ -170,14 +182,2 @@ // Create a new Request object.

// HTTP-redirect fetch step 9
if (res.statusCode !== 303 &&
request.body &&
getTotalBytes(request) === null) {
reject(new FetchError(
'Cannot follow redirect with body being a readable stream',
'unsupported-redirect'
))
finalize()
return
}
// HTTP-redirect fetch step 11

@@ -218,2 +218,4 @@ if (res.statusCode === 303 || (

counter: request.counter,
trailer: new Promise(resolve =>
res.on('end', () => resolve(createHeadersLenient(res.trailers))))
}

@@ -220,0 +222,0 @@

@@ -30,5 +30,10 @@ 'use strict'

counter: opts.counter,
trailer: Promise.resolve(opts.trailer || new Headers()),
}
}
get trailer () {
return this[INTERNALS].trailer
}
get url () {

@@ -66,2 +71,3 @@ return this[INTERNALS].url || ''

redirected: this.redirected,
trailer: this.trailer,
})

@@ -68,0 +74,0 @@ }

{
"name": "minipass-fetch",
"version": "1.1.2",
"version": "1.2.0",
"description": "An implementation of window.fetch in Node.js using Minipass streams",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc