@samitouri / QOSami-HFS / commits / 34395314

test: url login

Massimo Melina committed Feb 24, 2025 at 20:16 UTC 34395314ce585d30739f32de8f3aa00cd060a565
1 file changed +4 -1
tests/test.ts
+4 -1
@@ -126,7 +126,7 @@ describe('basics', () => {
126 }))
127
128 it('upload.need account', reqUpload( UPLOAD_DEST, 401))
129 - it('upload.post', done => {
129 + it('upload.post', done => { // this is also testing basic-auth
130 const cmd = `curl -u ${username}:${password} -F upload=@${SAMPLE_FILE_PATH} ${BASE_URL}${UPLOAD_ROOT}`;
131 exec(cmd, (err, out) => {
132 if (err) return done(err)
@@ -157,6 +157,9 @@ describe('basics', () => {
157 it('folder size.cant', reqApi('get_folder_size', { uri: 'for-admins' }, 401))
158
159 it('get_accounts', reqApi('get_accounts', {}, 401)) // admin api requires login
160 + it('url login', done =>
161 + exec(`curl -v "${BASE_URL}/for-admins/?login=${username}:${password}"`, (err, out) =>
162 + done(err || (out?.includes('Redirect') ? null : "failed")) ) )
163 })
164
165 // do this before login, or max_dl_accounts config will override max_dl