garrensmith commented on a change in pull request #1120: Use relative pathname 
instead of static pathname for local replication
URL: https://github.com/apache/couchdb-fauxton/pull/1120#discussion_r208108884
 
 

 ##########
 File path: app/addons/replication/__tests__/api.tests.js
 ##########
 @@ -81,6 +81,23 @@ describe('Replication API', () => {
       assert.ok(/my%2Fdb/.test(source.url));
     });
 
+    it('returns local source with auth info and encoded when use relative 
url', () => {
+      const localSource = 'my/db';
+      const source = getSource({
+        replicationSource: Constants.REPLICATION_SOURCE.LOCAL,
+        localSource,
+        sourceAuth: {
+          username: 'the-user',
+          password: 'password'
+        },
+        sourceAuthType: Constants.REPLICATION_AUTH_METHOD.BASIC
+      }, {origin: 'http://dev:6767', pathname:'/db/_utils'});
+
+      assert.deepEqual(source.headers, {Authorization:"Basic 
dGhlLXVzZXI6cGFzc3dvcmQ="});
+      console.log(source.url);
 
 Review comment:
   Can you remove the console.log

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to