couchdb-nano
couchdb-nano copied to clipboard
Revisit axios-cookiejar-support
In the 10.0.0 dependency bump, axios-cookiejar-support was left at ^1.0.1
when the latest is 2.0.4
. Why wasn't this updated in line with the others? Well...
- the syntax for how to implement
axios-cookiejar-support
has changed - this is not a big deal. Usage is https://github.com/3846masa/axios-cookiejar-support#usage - but it turns out
axios-cookiejar-support
doesn't like our use of custom http/https agents. In fact it refuses to run when they are supplied.Error [axios-cookiejar-support does not support for use with other http(s).Agent.].
Others have spotted this and the developer's advise is here https://github.com/3846masa/axios-cookiejar-support/issues/431. In short:
- use http-cookie-agent instead. This is another library by the same developer and is actually a dependency of
axios-cookiejar-support
- configure our agents to use ^
- scrap
axios-cookiejar-support
Doing it this way may also eliminate this bug at the same time: https://github.com/apache/couchdb-nano/issues/264.
This seems like it's worth a try, but didn't want to hold up v10 (any more than it was) while fiddling with it.
I think another feasible option would be to remove additional cookie-handling dependencies altogether from nano
or to make it optional. Instead, nano
could expose its axios
- instance and allow to overwrite/ wrap it, as needed.
May also be worth considering reducing reliance on axios altogether, especially now that the fetch
api has landed in node 18. A few years down the road and nano could be a very thin, practically dependency-free library. 🙂
@aeharding I was thinking about that. That would be a dream. Unfortunately, we'll have to wait until node 18 is the norm.