creationix / couch-client

A minimal CouchDB client that easy and powerful
MIT License
101 stars 9 forks source link

Basic auth #12

Closed steelThread closed 13 years ago

steelThread commented 13 years ago

Hey Tim,

As I mentioned in a recent issue that I posted, here are some updates to get couch-client working with the latest version of node. Not sure how much you are tracking node these days but the latest node version (0.3.6) includes new http and https client APIs. Myself as well as others seemed to be having problems when trying work use couch-client to communicate with couchone databases. This pull contains all the rework required to get this to work properly, namely: host header fix, authorization header for basic auth, new protocol request handling via the http and https node modules.

Since this fix only works with the most recent version of node I'm not sure how you want to manage these updates. It maybe advisable to create a branch/tag to pull this into. Not sure??

I think couch-client could use a good test suite too. I'll probably setup a more formal suite so myself and other users can be confident that couch-client works as advertised.

Thanks

creationix commented 13 years ago

Since I don't actually use couchdb right now, you're welcome to take over maintenance of the module. I can add you as a collaborator as long as you promise to not introduce scope creep.

I don't want to make it not run on node v0.2.x till 0.4.0 is released. (should be very soon now). It's possible to make it work for both, but it bloats the code a fair amount.

steelThread commented 13 years ago

Tim, these updates are working with node v0.4.0. There's another change that I want to introduce to the module to make it a bit more intuitive around the way defaults are applied. Users shouldn't be required to supply port numbers in the urls for well know port bindings to http & https endpoints. Unfortunately if you don't supply a port couch-client will give you the 5984 default. A better solution would be to apply the defaults if the url passed to the factory was just a path. It's a small thing but worth changing imo.

As far as the collaborator offer let me take a comprehensive look at the implementation first. I've only looked at the connection related bits up until this point.