Comments (8)
@mikeal is this an issue in request?
from nano.
I would like to have this patched in request
in everything that concerns http client
issues and nano
in everything that concerns CouchDB.
I'm still looking at your code and comments and trying to figure this out myself, so I should get back to you soon.
from nano.
I believe the problem is that nano doesn't (perhaps can't) instantiate request. This means that they all reference back to the same place (and therefore the same cookie jar). Try this out for example:
var fn1 = function () {
var request1 = require('request');
console.log('Should be undefined', request1.testProp);
request1.testProp = 1;
console.log('Should be 1', request1.testProp);
},
fn2 = function () {
var request2 = require('request');
console.log('Should be undefined', request2.testProp);
request2.testProp = 2;
console.log('Should be 2', request2.testProp);
};
fn1();
fn2();
console.log('Should be undefined', require('request').testProp);
from nano.
my 2 cents: I know that by default request uses the same cookie jar for all requests.
Maybe nano should expose the request options.jar option?
FYI, you can construct a cookie jar in request by calling:
var jar = request.jar()
and you can associate it to a request like this:
request({uri: uri, jar: jar})
if you don't want to use the cookie jar at all just pass jar: false
.
from nano.
I agree that this needs to be an option, however I personally believe that the default should be false
, as there is no genuine reason for nano using a cookie jar - that I can think of.
Its also confusing because whilst you can create separate instances of nano (and use them in isolation), the underlying request is a reference, not an instance - leading to potential confusion in the area of a jar. IMO
from nano.
nano can default to false.
var request = require('request').defaults({jar:false})
from nano.
Sorry, ignore 8a7fb4d - that was an accidental push! :)
from nano.
This looks awesome. I'll merge and review as soon as I get a free cycle!
from nano.
Related Issues (20)
- Does nano support purge? HOT 2
- db.attachment.get file- 'could not be opened because it is empty'
- Can not get correct userctx HOT 2
- Couch DB 2 compatibilty HOT 3
- bulk() with _deleted:true causes error HOT 3
- db.multipart.get does not work with Cloudant Local 1.0.0.5 HOT 1
- Enable permanent replication by writing to "_replicator" database instead of "_replicate" database. HOT 3
- Support temp view
- Doubt on db access of live app HOT 2
- What is the keys in view function based on? Is it the key you emit in the views/map function? HOT 1
- How do you update _rev to update a document?
- uploaded files displaying base64 data in the browser (attachments not viewable)
- Problem with OR -clauses? HOT 1
- Error: badarg every few hours
- Error: {error,emfile} HOT 1
- Example Lazy Creation of View
- Query string encoded when using array of keys
- Database permissions
- db.fetch array of id error
- Attempting to return simple list of documents, small issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nano.