apache / couchdb-nano

Nano: The official Apache CouchDB library for Node.js
https://www.npmjs.com/package/nano
Apache License 2.0
651 stars 165 forks source link

bring cookie handling in-house. Fixes issue #324 #325

Closed glynnbird closed 1 year ago

glynnbird commented 1 year ago

Overview

Fixes a bug in cookie parsing. See Issue #324.

Testing recommendations

As well as the automated testing, a long-running script to see if a session outlasts the first cookie:

const Nano = require('.')
const nano = Nano(process.env.COUCH_URL)

const sleep = async (ms) => {
  return new Promise((resolve, reject) => {
    setTimeout(resolve, ms)
  })
}
const main = async () => {
  await nano.auth(process.env.COUCH_USER, process.env.COUCH_PASSWORD)

  do {
    const r = await nano.db.list()
    console.log(new Date().toISOString(), r.length)
    await sleep(30000)
  } while (1)
}

main()

GitHub issue number

Fixes Issue #324.

Related Pull Requests

A provisional PR that replaces Axios already had code to bring cookie handling in-house, so this has been brought forward here. See https://github.com/apache/couchdb-nano/pull/314

Checklist