diff --git a/api/test/backup-data.test.js b/api/test/backup-data.test.js index 09f09dcf..7d437d5e 100644 --- a/api/test/backup-data.test.js +++ b/api/test/backup-data.test.js @@ -364,6 +364,15 @@ test('pbs-groups lists every group in every store and namespace', async () => { assert.equal(calls[0].opts.skipTls, true); }); +test('pbs-groups sends the token over https for an address with no scheme', async () => { + const { ctx, calls } = pbsCtx({}, 'pbs-groups', () => ({ status: 200, data: { data: [] } }), { + ...PBS_ROW, + pbsUrl: 'pbs.lan:8007/', + }); + await dataFn(ctx); + assert.equal(calls[0].url, 'https://pbs.lan:8007/api2/json/admin/datastore'); +}); + test('pbs-groups refuses a token that would break the header', async () => { const { ctx, calls } = pbsCtx({}, 'pbs-groups', () => null, { ...PBS_ROW, pbsSecret: 'abc\r\nX-Evil: 1' }); await assert.rejects(() => dataFn(ctx), /token ID/); diff --git a/ui/admin/index.html b/ui/admin/index.html index b2ce00ba..b6248d85 100644 --- a/ui/admin/index.html +++ b/ui/admin/index.html @@ -320,6 +320,6 @@