ActivityPub-federated video streaming platform using P2P directly in your web browser
urls: makefriends/quitfriends -> make-friends/quit-friends
Chocobozzzaa2e7f1501ce
diff --git a/client/src/app/+admin/friends/shared/friend.service.ts b/client/src/app/+admin/friends/shared/friend.service.tsindex 8bc0239ab9..9b3ff04b19 100644--- a/client/src/app/+admin/friends/shared/friend.service.ts+++ b/client/src/app/+admin/friends/shared/friend.service.ts@@ -26,13 +26,13 @@ export class FriendService {hosts: notEmptyHosts}- return this.authHttp.post(FriendService.BASE_FRIEND_URL + 'makefriends', body)+ return this.authHttp.post(FriendService.BASE_FRIEND_URL + 'make-friends', body).map(this.restExtractor.extractDataBool).catch((res) => this.restExtractor.handleError(res))}quitFriends () {- return this.authHttp.get(FriendService.BASE_FRIEND_URL + 'quitfriends')+ return this.authHttp.get(FriendService.BASE_FRIEND_URL + 'quit-friends').map(res => res.status).catch((res) => this.restExtractor.handleError(res))}diff --git a/server/controllers/api/pods.ts b/server/controllers/api/pods.tsindex e1fa4b7e8b..e1e8ff6cad 100644--- a/server/controllers/api/pods.ts+++ b/server/controllers/api/pods.ts@@ -35,14 +35,14 @@ podsRouter.post('/',podsAddValidator,addPods)-podsRouter.post('/makefriends',+podsRouter.post('/make-friends',authenticate,ensureIsAdmin,makeFriendsValidator,setBodyHostsPort,makeFriendsController)-podsRouter.get('/quitfriends',+podsRouter.get('/quit-friends',authenticate,ensureIsAdmin,quitFriendsControllerdiff --git a/server/tests/api/check-params/pods.ts b/server/tests/api/check-params/pods.tsindex 27c080931b..a897e4dcd9 100644--- a/server/tests/api/check-params/pods.ts+++ b/server/tests/api/check-params/pods.ts@@ -49,7 +49,7 @@ describe('Test pods API validators', function () {it('Should fail without hosts', async function () {await request(server.url)- .post(path + '/makefriends')+ .post(path + '/make-friends').set('Authorization', 'Bearer ' + server.accessToken).set('Accept', 'application/json').expect(400)@@ -57,7 +57,7 @@ describe('Test pods API validators', function () {it('Should fail if hosts is not an array', async function () {await request(server.url)- .post(path + '/makefriends')+ .post(path + '/make-friends').send({ hosts: 'localhost:9002' }).set('Authorization', 'Bearer ' + server.accessToken).set('Accept', 'application/json')@@ -66,7 +66,7 @@ describe('Test pods API validators', function () {it('Should fail if the array is not composed by hosts', async function () {await request(server.url)- .post(path + '/makefriends')+ .post(path + '/make-friends').send({ hosts: [ 'localhost:9002', 'localhost:coucou' ] }).set('Authorization', 'Bearer ' + server.accessToken).set('Accept', 'application/json')@@ -75,7 +75,7 @@ describe('Test pods API validators', function () {it('Should fail if the array is composed with http schemes', async function () {await request(server.url)- .post(path + '/makefriends')+ .post(path + '/make-friends').send({ hosts: [ 'localhost:9002', 'http://localhost:9003' ] }).set('Authorization', 'Bearer ' + server.accessToken).set('Accept', 'application/json')@@ -84,7 +84,7 @@ describe('Test pods API validators', function () {it('Should fail if hosts are not unique', async function () {await request(server.url)- .post(path + '/makefriends')+ .post(path + '/make-friends').send({ urls: [ 'localhost:9002', 'localhost:9002' ] }).set('Authorization', 'Bearer ' + server.accessToken).set('Accept', 'application/json')@@ -93,16 +93,16 @@ describe('Test pods API validators', function () {it('Should fail with an invalid token', async function () {await request(server.url)- .post(path + '/makefriends')+ .post(path + '/make-friends').send(body)- .set('Authorization', 'Bearer faketoken')+ .set('Authorization', 'Bearer fake_token').set('Accept', 'application/json').expect(401)})it('Should fail if the user is not an administrator', async function () {await request(server.url)- .post(path + '/makefriends')+ .post(path + '/make-friends').send(body).set('Authorization', 'Bearer ' + userAccessToken).set('Accept', 'application/json')@@ -113,7 +113,7 @@ describe('Test pods API validators', function () {describe('When quitting friends', function () {it('Should fail with an invalid token', async function () {await request(server.url)- .get(path + '/quitfriends')+ .get(path + '/quit-friends').query({ start: 'hello' }).set('Authorization', 'Bearer faketoken').set('Accept', 'application/json')@@ -122,7 +122,7 @@ describe('Test pods API validators', function () {it('Should fail if the user is not an administrator', async function () {await request(server.url)- .get(path + '/quitfriends')+ .get(path + '/quit-friends').query({ start: 'hello' }).set('Authorization', 'Bearer ' + userAccessToken).set('Accept', 'application/json')diff --git a/server/tests/utils/pods.ts b/server/tests/utils/pods.tsindex 0bea6db978..a86dd20d91 100644--- a/server/tests/utils/pods.ts+++ b/server/tests/utils/pods.ts@@ -37,7 +37,7 @@ async function makeFriends (url: string, accessToken: string, expectedStatus = 2'localhost:9003']}- const path = '/api/v1/pods/makefriends'+ const path = '/api/v1/pods/make-friends'// The first pod make friend with the thirdconst res = await request(url)@@ -54,7 +54,7 @@ async function makeFriends (url: string, accessToken: string, expectedStatus = 2}async function quitFriends (url: string, accessToken: string, expectedStatus = 204) {- const path = '/api/v1/pods/quitfriends'+ const path = '/api/v1/pods/quit-friends'// The first pod make friend with the thirdconst res = await request(url)