aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/controllers/api/v1/index.js2
-rw-r--r--server/controllers/api/v1/pods.js6
-rw-r--r--server/controllers/api/v1/remoteVideos.js2
-rw-r--r--server/controllers/api/v1/videos.js6
4 files changed, 8 insertions, 8 deletions
diff --git a/server/controllers/api/v1/index.js b/server/controllers/api/v1/index.js
index abbc5eb60..b562bc2af 100644
--- a/server/controllers/api/v1/index.js
+++ b/server/controllers/api/v1/index.js
@@ -20,5 +20,5 @@ module.exports = router
20// --------------------------------------------------------------------------- 20// ---------------------------------------------------------------------------
21 21
22function badRequest (req, res, next) { 22function badRequest (req, res, next) {
23 res.sendStatus(400) 23 res.type('json').status(400).end()
24} 24}
diff --git a/server/controllers/api/v1/pods.js b/server/controllers/api/v1/pods.js
index c93a86ee8..fa9832914 100644
--- a/server/controllers/api/v1/pods.js
+++ b/server/controllers/api/v1/pods.js
@@ -66,7 +66,7 @@ function makeFriends (req, res, next) {
66 friends.makeFriends(function (err) { 66 friends.makeFriends(function (err) {
67 if (err) return next(err) 67 if (err) return next(err)
68 68
69 res.sendStatus(204) 69 res.type('json').status(204).end()
70 }) 70 })
71} 71}
72 72
@@ -79,7 +79,7 @@ function removePods (req, res, next) {
79 if (err) logger.error('Cannot remove all remote videos of %s.', url) 79 if (err) logger.error('Cannot remove all remote videos of %s.', url)
80 else logger.info('%s pod removed.', url) 80 else logger.info('%s pod removed.', url)
81 81
82 res.sendStatus(204) 82 res.type('json').status(204).end()
83 }) 83 })
84 }) 84 })
85} 85}
@@ -88,6 +88,6 @@ function quitFriends (req, res, next) {
88 friends.quitFriends(function (err) { 88 friends.quitFriends(function (err) {
89 if (err) return next(err) 89 if (err) return next(err)
90 90
91 res.sendStatus(204) 91 res.type('json').status(204).end()
92 }) 92 })
93} 93}
diff --git a/server/controllers/api/v1/remoteVideos.js b/server/controllers/api/v1/remoteVideos.js
index 475a874cf..7622e39f5 100644
--- a/server/controllers/api/v1/remoteVideos.js
+++ b/server/controllers/api/v1/remoteVideos.js
@@ -48,6 +48,6 @@ function removeRemoteVideo (req, res, next) {
48 videos.removeRemotesOfByMagnetUris(url, magnetUris, function (err) { 48 videos.removeRemotesOfByMagnetUris(url, magnetUris, function (err) {
49 if (err) return next(err) 49 if (err) return next(err)
50 50
51 res.sendStatus(204) 51 res.type('json').status(204).end()
52 }) 52 })
53} 53}
diff --git a/server/controllers/api/v1/videos.js b/server/controllers/api/v1/videos.js
index 620711925..9398aabb7 100644
--- a/server/controllers/api/v1/videos.js
+++ b/server/controllers/api/v1/videos.js
@@ -77,7 +77,7 @@ function addVideo (req, res, next) {
77 friends.addVideoToFriends(video_data) 77 friends.addVideoToFriends(video_data)
78 78
79 // TODO : include Location of the new video 79 // TODO : include Location of the new video
80 res.sendStatus(201) 80 res.type('json').status(201).end()
81 }) 81 })
82 }) 82 })
83} 83}
@@ -87,7 +87,7 @@ function getVideos (req, res, next) {
87 if (err) return next(err) 87 if (err) return next(err)
88 88
89 if (video === null) { 89 if (video === null) {
90 return res.sendStatus(404) 90 res.type('json').status(204).end()
91 } 91 }
92 92
93 res.json(video) 93 res.json(video)
@@ -117,7 +117,7 @@ function removeVideo (req, res, next) {
117 } 117 }
118 118
119 friends.removeVideoToFriends(params) 119 friends.removeVideoToFriends(params)
120 res.sendStatus(204) 120 res.type('json').status(204).end()
121 }) 121 })
122 }) 122 })
123 }) 123 })