Skip to content
This repository has been archived by the owner on Nov 5, 2018. It is now read-only.

nano URL parsing #56

Closed
shimaore opened this issue Feb 19, 2012 · 3 comments
Closed

nano URL parsing #56

shimaore opened this issue Feb 19, 2012 · 3 comments
Labels

Comments

@shimaore
Copy link

In nano 1.3.2, the port number gets junked:

nano('http://127.0.0.1:5984/db')  =>  config: { url: 'http://127.0.0.1', db: 'db' }

A simple rewrite would be:

cfg.url = u.format({protocol:path.protocol,host:path.host})

While I'm at it I'd like to suggest to do

db = path_array.pop()
cfg.url = u.format({protocol:path.protocol,host:path.host,pathname:path_array.join('/')})

so that the path doesn't get junked as well:

nano('http://127.0.0.1:5984/path/to/db')  =>    config: { url: 'http://127.0.0.1:5984/path/to', db: 'db' }
@dscape
Copy link
Contributor

dscape commented Feb 19, 2012

Thanks for reporting, please send in a pull request :) I'll accept it.

@dscape
Copy link
Contributor

dscape commented Feb 19, 2012

@shimaore database a/c would be a%2Fc.

are you suggesting I should read that and do the encoding for the person?

@dscape dscape closed this as completed in 750fda1 Feb 19, 2012
@dscape
Copy link
Contributor

dscape commented Feb 19, 2012

Published as nano@1.3.3 on npm.

thanks for the report.

as for the database name that has / please let me know if that still an issue :)

i added you to the contributors list anyway :)

KangTheTerrible pushed a commit to KangTheTerrible/nano that referenced this issue Aug 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants