Socket
Socket
Sign inDemoInstall

digest-fetch

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

digest-fetch - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

10

digest-fetch-src.js

@@ -9,7 +9,7 @@ const canRequire = typeof(require) == 'function'

const parse = (raw, field) => {
const parse = (raw, field, trim=true) => {
const regex = new RegExp(`${field}=("[^"]*"|[^,]*)`, "i")
const match = regex.exec(raw)
if (match)
return match[1].replace(/[\s"]/g, '')
return trim ? match[1].replace(/[\s"]/g, '') : match[1]
return null

@@ -138,3 +138,3 @@ }

this.digest.realm = parse(h, 'realm') || ''
this.digest.realm = (parse(h, 'realm', false) || '').replace(/["]/g, '')

@@ -176,4 +176,4 @@ this.digest.qop = this.parseQop(h)

static parse(raw, field) {
return parse(raw, field)
static parse(...args) {
return parse(...args)
}

@@ -180,0 +180,0 @@ }

{
"name": "digest-fetch",
"version": "1.1.0",
"version": "1.1.1",
"description": "digest auth request plugin for fetch/node-fetch also support http basic auth authentication",

@@ -5,0 +5,0 @@ "main": "digest-fetch-src.js",

@@ -26,2 +26,7 @@ process.env.NO_DEPRECATION = 'digest-fetch';

assert.equal(DigestFetch.parse('a="v1,v2"', 'a'), 'v1,v2')
const client = new DigestFetch("", "")
client.parseAuth('qop=auth-int,realm=test')
assert.equal(client.digest.realm, "test")
client.parseAuth('qop="auth",realm="v1 v2"')
assert.equal(client.digest.realm, "v1 v2")
})

@@ -28,0 +33,0 @@

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc