From 49abbbbedca83b9031d3e2eb3ae9ad9b6a7d96ed Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 14 Nov 2016 20:03:04 +0100 Subject: Pod URL -> pod host. HTTPS is required to make friends. Reason: in a network with mix http/https pods, https pods won't be able to play videos from http pod (insecure requests). --- server/controllers/api/pods.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'server/controllers/api/pods.js') diff --git a/server/controllers/api/pods.js b/server/controllers/api/pods.js index 853e0705b..7857fcee0 100644 --- a/server/controllers/api/pods.js +++ b/server/controllers/api/pods.js @@ -20,14 +20,14 @@ const Pod = mongoose.model('Pod') router.get('/', listPods) router.post('/', validators.podsAdd, - podsMiddleware.setBodyUrlPort, + podsMiddleware.setBodyHostPort, addPods ) router.post('/makefriends', oAuth.authenticate, admin.ensureIsAdmin, validators.makeFriends, - podsMiddleware.setBodyUrlsPort, + podsMiddleware.setBodyHostsPort, makeFriends ) router.get('/quitfriends', @@ -84,17 +84,17 @@ function addPods (req, res, next) { } function listPods (req, res, next) { - Pod.list(function (err, podsUrlList) { + Pod.list(function (err, podsList) { if (err) return next(err) - res.json(getFormatedPods(podsUrlList)) + res.json(getFormatedPods(podsList)) }) } function makeFriends (req, res, next) { - const urls = req.body.urls + const hosts = req.body.hosts - friends.makeFriends(urls, function (err) { + friends.makeFriends(hosts, function (err) { if (err) { logger.error('Could not make friends.', { error: err }) return @@ -107,11 +107,11 @@ function makeFriends (req, res, next) { } function removePods (req, res, next) { - const url = req.body.signature.url + const host = req.body.signature.host waterfall([ function loadPod (callback) { - Pod.loadByUrl(url, callback) + Pod.loadByHost(host, callback) }, function removePod (pod, callback) { -- cgit v1.2.3