Server: move requests lib in their own directory

pull/71/head
Chocobozzz 2017-05-05 17:35:58 +02:00
parent 4e284e97b9
commit 5a976a8c35
7 changed files with 18 additions and 16 deletions

View File

@ -40,7 +40,7 @@ function makeSecureRequest (params, callback) {
let dataToSign
if (params.data) {
dataToSign = dataToSign = params.data
dataToSign = params.data
} else {
// We do not have data to sign so we just take our host
// It is not ideal but the connection should be in HTTPS

View File

@ -13,9 +13,9 @@ const logger = require('../helpers/logger')
const peertubeCrypto = require('../helpers/peertube-crypto')
const requests = require('../helpers/requests')
const utils = require('../helpers/utils')
const RequestScheduler = require('./request-scheduler')
const RequestVideoQaduScheduler = require('./request-video-qadu-scheduler')
const RequestVideoEventScheduler = require('./request-video-event-scheduler')
const RequestScheduler = require('./request/request-scheduler')
const RequestVideoQaduScheduler = require('./request/request-video-qadu-scheduler')
const RequestVideoEventScheduler = require('./request/request-video-event-scheduler')
const ENDPOINT_ACTIONS = constants.REQUEST_ENDPOINT_ACTIONS[constants.REQUEST_ENDPOINTS.VIDEOS]

View File

@ -2,10 +2,10 @@
const eachLimit = require('async/eachLimit')
const constants = require('../initializers/constants')
const db = require('../initializers/database')
const logger = require('../helpers/logger')
const requests = require('../helpers/requests')
const constants = require('../../initializers/constants')
const db = require('../../initializers/database')
const logger = require('../../helpers/logger')
const requests = require('../../helpers/requests')
module.exports = class BaseRequestScheduler {
constructor (options) {

View File

@ -1,9 +1,9 @@
'use strict'
const constants = require('../initializers/constants')
const constants = require('../../initializers/constants')
const BaseRequestScheduler = require('./base-request-scheduler')
const db = require('../initializers/database')
const logger = require('../helpers/logger')
const db = require('../../initializers/database')
const logger = require('../../helpers/logger')
module.exports = class RequestScheduler extends BaseRequestScheduler {
constructor () {

View File

@ -1,8 +1,8 @@
'use strict'
const BaseRequestScheduler = require('./base-request-scheduler')
const constants = require('../initializers/constants')
const db = require('../initializers/database')
const constants = require('../../initializers/constants')
const db = require('../../initializers/database')
module.exports = class RequestVideoEventScheduler extends BaseRequestScheduler {
constructor () {

View File

@ -1,9 +1,9 @@
'use strict'
const BaseRequestScheduler = require('./base-request-scheduler')
const constants = require('../initializers/constants')
const db = require('../initializers/database')
const logger = require('../helpers/logger')
const constants = require('../../initializers/constants')
const db = require('../../initializers/database')
const logger = require('../../helpers/logger')
module.exports = class RequestVideoQaduScheduler extends BaseRequestScheduler {
constructor () {

View File

@ -24,6 +24,8 @@ function checkSignature (req, res, next) {
logger.debug('Checking signature from %s.', host)
let signatureShouldBe
// If there is data in the body the sender used it for its signature
// If there is no data we just use its host as signature
if (req.body.data) {
signatureShouldBe = req.body.data
} else {