validate response of federation APIs (#2408)
* validate json responses * update deps * tmp disable header check * log all the webfinger fails refactor and filter more malformed requests * don't set incorrect serverURL strings * test failing through admin api * fix server url in fedi tests * check response.text * validate json/xml response of all apis test Content-Type of api response and cleanup * improve logs * fix rebase * cleanup json parser in api tests * mark the api tests performed by admin * Separate check for reading and format of serverURL * test /federation/user/ with wrong username in ci
This commit is contained in:
@@ -3,6 +3,7 @@ var request = require('supertest');
|
||||
const Random = require('crypto-random');
|
||||
|
||||
const sendAdminRequest = require('./lib/admin').sendAdminRequest;
|
||||
const failAdminRequest = require('./lib/admin').failAdminRequest;
|
||||
const getAdminResponse = require('./lib/admin').getAdminResponse;
|
||||
|
||||
request = request('http://127.0.0.1:8080');
|
||||
@@ -245,6 +246,10 @@ test('set forbidden usernames', async (done) => {
|
||||
});
|
||||
|
||||
test('set server url', async (done) => {
|
||||
const resBadURL = await failAdminRequest(
|
||||
'config/serverurl',
|
||||
'not.valid.url'
|
||||
);
|
||||
const res = await sendAdminRequest(
|
||||
'config/serverurl',
|
||||
newYPConfig.instanceUrl
|
||||
|
||||
Reference in New Issue
Block a user