aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-05-05 17:35:58 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-05-05 17:35:58 +0200
commit5a976a8c351d2a9e23ceee1e193fca2893b7f12d (patch)
tree9e22c1cf835b68082bc3a12adf6a0a7b40e6ce7f
parent4e284e97b95d1fe93378b90061272e3abc875078 (diff)
downloadPeerTube-5a976a8c351d2a9e23ceee1e193fca2893b7f12d.tar.gz
PeerTube-5a976a8c351d2a9e23ceee1e193fca2893b7f12d.tar.zst
PeerTube-5a976a8c351d2a9e23ceee1e193fca2893b7f12d.zip
Server: move requests lib in their own directory
-rw-r--r--server/helpers/requests.js2
-rw-r--r--server/lib/friends.js6
-rw-r--r--server/lib/request/base-request-scheduler.js (renamed from server/lib/base-request-scheduler.js)8
-rw-r--r--server/lib/request/request-scheduler.js (renamed from server/lib/request-scheduler.js)6
-rw-r--r--server/lib/request/request-video-event-scheduler.js (renamed from server/lib/request-video-event-scheduler.js)4
-rw-r--r--server/lib/request/request-video-qadu-scheduler.js (renamed from server/lib/request-video-qadu-scheduler.js)6
-rw-r--r--server/middlewares/secure.js2
7 files changed, 18 insertions, 16 deletions
diff --git a/server/helpers/requests.js b/server/helpers/requests.js
index 427864117..efe056937 100644
--- a/server/helpers/requests.js
+++ b/server/helpers/requests.js
@@ -40,7 +40,7 @@ function makeSecureRequest (params, callback) {
40 40
41 let dataToSign 41 let dataToSign
42 if (params.data) { 42 if (params.data) {
43 dataToSign = dataToSign = params.data 43 dataToSign = params.data
44 } else { 44 } else {
45 // We do not have data to sign so we just take our host 45 // We do not have data to sign so we just take our host
46 // It is not ideal but the connection should be in HTTPS 46 // It is not ideal but the connection should be in HTTPS
diff --git a/server/lib/friends.js b/server/lib/friends.js
index 1c7567527..6dd32406c 100644
--- a/server/lib/friends.js
+++ b/server/lib/friends.js
@@ -13,9 +13,9 @@ const logger = require('../helpers/logger')
13const peertubeCrypto = require('../helpers/peertube-crypto') 13const peertubeCrypto = require('../helpers/peertube-crypto')
14const requests = require('../helpers/requests') 14const requests = require('../helpers/requests')
15const utils = require('../helpers/utils') 15const utils = require('../helpers/utils')
16const RequestScheduler = require('./request-scheduler') 16const RequestScheduler = require('./request/request-scheduler')
17const RequestVideoQaduScheduler = require('./request-video-qadu-scheduler') 17const RequestVideoQaduScheduler = require('./request/request-video-qadu-scheduler')
18const RequestVideoEventScheduler = require('./request-video-event-scheduler') 18const RequestVideoEventScheduler = require('./request/request-video-event-scheduler')
19 19
20const ENDPOINT_ACTIONS = constants.REQUEST_ENDPOINT_ACTIONS[constants.REQUEST_ENDPOINTS.VIDEOS] 20const ENDPOINT_ACTIONS = constants.REQUEST_ENDPOINT_ACTIONS[constants.REQUEST_ENDPOINTS.VIDEOS]
21 21
diff --git a/server/lib/base-request-scheduler.js b/server/lib/request/base-request-scheduler.js
index 7378971c8..782448340 100644
--- a/server/lib/base-request-scheduler.js
+++ b/server/lib/request/base-request-scheduler.js
@@ -2,10 +2,10 @@
2 2
3const eachLimit = require('async/eachLimit') 3const eachLimit = require('async/eachLimit')
4 4
5const constants = require('../initializers/constants') 5const constants = require('../../initializers/constants')
6const db = require('../initializers/database') 6const db = require('../../initializers/database')
7const logger = require('../helpers/logger') 7const logger = require('../../helpers/logger')
8const requests = require('../helpers/requests') 8const requests = require('../../helpers/requests')
9 9
10module.exports = class BaseRequestScheduler { 10module.exports = class BaseRequestScheduler {
11 constructor (options) { 11 constructor (options) {
diff --git a/server/lib/request-scheduler.js b/server/lib/request/request-scheduler.js
index f6020e746..555ec3e54 100644
--- a/server/lib/request-scheduler.js
+++ b/server/lib/request/request-scheduler.js
@@ -1,9 +1,9 @@
1'use strict' 1'use strict'
2 2
3const constants = require('../initializers/constants') 3const constants = require('../../initializers/constants')
4const BaseRequestScheduler = require('./base-request-scheduler') 4const BaseRequestScheduler = require('./base-request-scheduler')
5const db = require('../initializers/database') 5const db = require('../../initializers/database')
6const logger = require('../helpers/logger') 6const logger = require('../../helpers/logger')
7 7
8module.exports = class RequestScheduler extends BaseRequestScheduler { 8module.exports = class RequestScheduler extends BaseRequestScheduler {
9 constructor () { 9 constructor () {
diff --git a/server/lib/request-video-event-scheduler.js b/server/lib/request/request-video-event-scheduler.js
index c7631253a..e54d34f4a 100644
--- a/server/lib/request-video-event-scheduler.js
+++ b/server/lib/request/request-video-event-scheduler.js
@@ -1,8 +1,8 @@
1'use strict' 1'use strict'
2 2
3const BaseRequestScheduler = require('./base-request-scheduler') 3const BaseRequestScheduler = require('./base-request-scheduler')
4const constants = require('../initializers/constants') 4const constants = require('../../initializers/constants')
5const db = require('../initializers/database') 5const db = require('../../initializers/database')
6 6
7module.exports = class RequestVideoEventScheduler extends BaseRequestScheduler { 7module.exports = class RequestVideoEventScheduler extends BaseRequestScheduler {
8 constructor () { 8 constructor () {
diff --git a/server/lib/request-video-qadu-scheduler.js b/server/lib/request/request-video-qadu-scheduler.js
index a85d35160..17402b556 100644
--- a/server/lib/request-video-qadu-scheduler.js
+++ b/server/lib/request/request-video-qadu-scheduler.js
@@ -1,9 +1,9 @@
1'use strict' 1'use strict'
2 2
3const BaseRequestScheduler = require('./base-request-scheduler') 3const BaseRequestScheduler = require('./base-request-scheduler')
4const constants = require('../initializers/constants') 4const constants = require('../../initializers/constants')
5const db = require('../initializers/database') 5const db = require('../../initializers/database')
6const logger = require('../helpers/logger') 6const logger = require('../../helpers/logger')
7 7
8module.exports = class RequestVideoQaduScheduler extends BaseRequestScheduler { 8module.exports = class RequestVideoQaduScheduler extends BaseRequestScheduler {
9 constructor () { 9 constructor () {
diff --git a/server/middlewares/secure.js b/server/middlewares/secure.js
index b6e6d818b..7c5c72508 100644
--- a/server/middlewares/secure.js
+++ b/server/middlewares/secure.js
@@ -24,6 +24,8 @@ function checkSignature (req, res, next) {
24 logger.debug('Checking signature from %s.', host) 24 logger.debug('Checking signature from %s.', host)
25 25
26 let signatureShouldBe 26 let signatureShouldBe
27 // If there is data in the body the sender used it for its signature
28 // If there is no data we just use its host as signature
27 if (req.body.data) { 29 if (req.body.data) {
28 signatureShouldBe = req.body.data 30 signatureShouldBe = req.body.data
29 } else { 31 } else {