Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nano

Package Overview
Dependencies
Maintainers
7
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nano - npm Package Compare versions

Comparing version 10.1.1 to 10.1.2

lib/cookie.js

36

lib/nano.js

@@ -13,16 +13,16 @@ // Licensed under the Apache License, Version 2.0 (the 'License'); you may not

const { HttpsCookieAgent, HttpCookieAgent } = require('http-cookie-agent/http')
const { URL } = require('url')
const http = require('http')
const https = require('https')
const assert = require('assert')
const querystring = require('qs')
const axios = require('axios')
const { CookieJar } = require('tough-cookie')
const cookieJar = new CookieJar()
const stream = require('stream')
const pkg = require('../package.json')
const AGENT_DEFAULTS = { cookies: { jar: cookieJar }, keepAlive: true, maxSockets: 50, keepAliveMsecs: 30000 }
const AGENT_DEFAULTS = { keepAlive: true, maxSockets: 50, keepAliveMsecs: 30000 }
const defaultHttpAgent = new http.Agent(AGENT_DEFAULTS)
const defaultHttpsAgent = new https.Agent(AGENT_DEFAULTS)
const SCRUBBED_STR = 'XXXXXX'
const defaultHttpAgent = new HttpCookieAgent(AGENT_DEFAULTS)
const defaultHttpsAgent = new HttpsCookieAgent(AGENT_DEFAULTS)
const ChangesReader = require('./changesreader.js')
const CookieJar = require('./cookie.js')
const MultiPartFactory = require('./multipart.js')

@@ -81,2 +81,5 @@

// create cookieJar for this Nano
cfg.cookieJar = new CookieJar()
function maybeExtractDatabaseComponent () {

@@ -128,2 +131,12 @@ if (!parseUrl) {

// cookie parsing
if (response.headers) {
const h = response.headers['set-cookie']
if (h && h.length) {
h.forEach((header) => {
cfg.cookieJar.parse(header, req.url)
})
}
}
// let parsed

@@ -288,3 +301,2 @@ const responseHeaders = Object.assign({

if (isJar) {
req.jar = cookieJar
req.withCredentials = true

@@ -357,2 +369,8 @@ }

// add any cookies for this domain
const cookie = cfg.cookieJar.getCookieString(req.uri)
if (cookie) {
req.headers.cookie = cookie
}
if (opts.body) {

@@ -383,4 +401,2 @@ if (Buffer.isBuffer(opts.body) || opts.dontStringify) {

cfg.cookies = cookieJar.getCookiesSync(cfg.url)
// This where the HTTP request is made.

@@ -418,4 +434,2 @@ // Nano used to use the now-deprecated "request" library but now we're going to

req.httpsAgent = cfg.requestDefaults.agent || defaultHttpsAgent
req.httpAgent.jar = req.httpAgent.jar ? req.httpAgent.jar : cookieJar
req.httpsAgent.jar = req.httpsAgent.jar ? req.httpsAgent.jar : cookieJar
const ax = axios.create({

@@ -422,0 +436,0 @@ httpAgent: req.httpAgent,

@@ -7,3 +7,3 @@ {

"repository": "http://github.com/apache/couchdb-nano",
"version": "10.1.1",
"version": "10.1.2",
"author": "Apache CouchDB <dev@couchdb.apache.org> (http://couchdb.apache.org)",

@@ -21,7 +21,4 @@ "keywords": [

"dependencies": {
"http-cookie-agent": "^5.0.2",
"@types/tough-cookie": "^4.0.2",
"axios": "^1.2.2",
"qs": "^6.11.0",
"tough-cookie": "^4.1.2",
"node-abort-controller": "^3.0.1"

@@ -28,0 +25,0 @@ },

@@ -575,3 +575,3 @@ [![NPM](http://img.shields.io/npm/v/nano.svg?style=flat-square)](https://www.npmjs.com/package/nano)

Bulk operations(update/delete/insert) on the database, refer to the
[CouchDB doc](https://docs.couchdb.org/en/2.1.1/api/database/bulk-api.html#db-bulk-docs) e.g:
[CouchDB doc](https://docs.couchdb.org/en/stable/api/database/bulk-api.html#post--db-_bulk_docs) e.g:

@@ -578,0 +578,0 @@ ```js

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