You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "domachine (via GitHub)" <gi...@apache.org> on 2026/02/06 08:08:30 UTC

[I] Bug when using a password with special chars in the url passed to nano [couchdb-nano]

domachine opened a new issue, #363:
URL: https://github.com/apache/couchdb-nano/issues/363

   Hi,
   
   I think I encountered a bug when passing a url with embedded credentials (`url.username` and `url.password`) to nano. I always get an unauthorized error from couchdb when having special chars in the password. This does not happen if the password does not have special chars. I peeked a bit in the source code and found that the `URL` constructor is used to read the password which is then encoded in the authorization header.
   
   I did some tests and I think the problem is that the `password` property returns the password in percent encoding (which is not intuitive to me since the `searchParams` are decoded when reading 🤷‍♂️). This behavior is also described on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/URL/password):
   
   > The password is [percent-encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding) when setting but not percent-decoded when reading.
   
   Am I missing something?
   
   **Note**: I'm using the "new" nano 11.
   
   Thank you very much for the time and effort you put into couchdb and the ecosystem ❤️.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Bug when using a password with special chars in the url passed to nano [couchdb-nano]

Posted by "glynnbird (via GitHub)" <gi...@apache.org>.
glynnbird commented on issue #363:
URL: https://github.com/apache/couchdb-nano/issues/363#issuecomment-3859003582

   Thanks for the report.
   
   I did manage to reproduce this. It turns out that Node.js's `new URL` returns a [percent-encoded password](https://nodejs.org/api/url.html#urlpassword) and [percent-encoded username](https://nodejs.org/api/url.html#urlpassword) so I'll have to take that into account.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Bug when using a password with special chars in the url passed to nano [couchdb-nano]

Posted by "glynnbird (via GitHub)" <gi...@apache.org>.
glynnbird closed issue #363: Bug when using a password with special chars in the url passed to nano
URL: https://github.com/apache/couchdb-nano/issues/363


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Bug when using a password with special chars in the url passed to nano [couchdb-nano]

Posted by "glynnbird (via GitHub)" <gi...@apache.org>.
glynnbird commented on issue #363:
URL: https://github.com/apache/couchdb-nano/issues/363#issuecomment-3860313129

   Fixed in nano@11.0.4


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org