- // Add data with POST requst ?
- if (params.method === 'POST') {
- requestParams.json = {}
-
- // Add signature if it is specified in the params
- if (params.sign === true) {
- requestParams.json.signature = {
- url: myUrl,
- signature: peertubeCrypto.sign(myUrl)
- }
- }
+ if (params.method !== 'POST') {
+ return callback(new Error('Cannot make a secure request with a non POST method.'))
+ }