Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Return next to send a 500 status code

Chocobozzze63dc45fa368
diff --git a/routes/api/pods.js b/routes/api/pods.js
index 3f9e850522..8fa29b4f79 100644
--- a/routes/api/pods.js
+++ b/routes/api/pods.js
@@ -8,7 +8,7 @@
function listPods (req, res, next) {
pods.list(function (err, pods_list) {
- if (err) next(err)
+ if (err) return next(err)
res.json(pods_list)
})
@@ -16,7 +16,7 @@
function addPods (req, res, next) {
pods.add(req.body.data, function (err, json) {
- if (err) next(err)
+ if (err) return next(err)
res.json(json)
})
@@ -24,7 +24,7 @@
function makeFriends (req, res, next) {
pods.makeFriends(function (err) {
- if (err) next(err)
+ if (err) return next(err)
res.sendStatus(204)
})
diff --git a/routes/api/remoteVideos.js b/routes/api/remoteVideos.js
index eed586d236..2ae3ce5bc5 100644
--- a/routes/api/remoteVideos.js
+++ b/routes/api/remoteVideos.js
@@ -8,7 +8,7 @@
function addRemoteVideos (req, res, next) {
videos.addRemote(req.body.data, function (err, video) {
- if (err) next(err)
+ if (err) return next(err)
res.json(video)
})
@@ -16,7 +16,7 @@
function removeRemoteVideo (req, res, next) {
videos.removeRemote(req.body.signature.url, req.body.data.magnetUri, function (err) {
- if (err) next(err)
+ if (err) return next(err)
res.status(204)
})
diff --git a/routes/api/videos.js b/routes/api/videos.js
index c38d6d42c4..087fc96bc9 100644
--- a/routes/api/videos.js
+++ b/routes/api/videos.js
@@ -8,7 +8,7 @@
function listVideos (req, res, next) {
videos.list(function (err, videos_list) {
- if (err) next(err)
+ if (err) return next(err)
res.json(videos_list)
})
@@ -16,7 +16,7 @@
function searchVideos (req, res, next) {
videos.search(req.params.name, function (err, videos_list) {
- if (err) next(err)
+ if (err) return next(err)
res.json(videos_list)
})
@@ -24,7 +24,7 @@
function addVideos (req, res, next) {
videos.add({ video: req.files.input_video, data: req.body }, function (err) {
- if (err) next(err)
+ if (err) return next(err)
// TODO : include Location of the new video
res.sendStatus(201)
@@ -33,7 +33,7 @@
function getVideos (req, res, next) {
videos.get(req.params.id, function (err, video) {
- if (err) next(err)
+ if (err) return next(err)
if (video === null) {
return res.sendStatus(404)
@@ -45,7 +45,7 @@
function removeVideo (req, res, next) {
videos.remove(req.params.id, function (err) {
- if (err) next(err)
+ if (err) return next(err)
res.sendStatus(204)
})