SinanGabel commented on issue #174:
URL: https://github.com/apache/couchdb-nano/issues/174#issuecomment-622280223


   Hi,
   
   Perhaps the user name and password could be passed as Header in a HTTP POST
   (GET to?) command, something like:
   
   $.ajax({
     type: 'POST',
     url: http://theappurl.com/api/v1/method/,
     data: {},
     crossDomain: true,
     beforeSend: function(xhr) {
       xhr.setRequestHeader('Authorization', 'Basic ' +
   btoa(unescape(encodeURIComponent(YOUR_USERNAME + ':' +
   YOUR_PASSWORD))))
     }});
   
   Source: 
https://stackoverflow.com/questions/18264601/how-to-send-a-correct-authorization-header-for-basic-authentication
   
   Source: https://developer.mozilla.org/en-US/docs/Glossary/Base64
   
   Source: 
https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
   
   
   On Wed, 7 Aug 2019 at 11:42, Matthias <[email protected]> wrote:
   
   > Nano does not parse a CouchDB host, username, and password correctly if
   > the password which is passed to the constructor contains special 
characters.
   > Steps to Reproduce (for bugs)
   >
   > import * as Nano  from 'nano'
   >
   > let n = Nano('http://admin:g[?6asdwrF@localhost:5984');
   > console.log(n);
   > let db = n.db.use('people');
   >
   > Your Environment
   >
   >    - Version used: 8.1.0
   >    - Operating System and version (desktop or mobile): macOs 10.14.6
   >
   > —
   > You are receiving this because you are subscribed to this thread.
   > Reply to this email directly, view it on GitHub
   > 
<https://github.com/apache/couchdb-nano/issues/174?email_source=notifications&email_token=ABKTZUWO5EK4TV77NTVUW3TQDKKJDA5CNFSM4IJ6N732YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HD26LTA>,
   > or mute the thread
   > 
<https://github.com/notifications/unsubscribe-auth/ABKTZUS5I3SEBU5QANEC5MDQDKKJDANCNFSM4IJ6N73Q>
   > .
   >
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to