Fixed error when sending empty body responses and fixed eslint error

This commit is contained in:
emad-salah 2020-06-05 18:48:28 +01:00
parent 0afeff22b4
commit b6a680d550
2 changed files with 4 additions and 4 deletions

View file

@ -249,7 +249,7 @@ module.exports = async (
return res.status(401).json(error);
}
if (req.method === "GET") {
if (req.method === "GET" || req.method === "DELETE" || !req.body.encryptionKey && !req.body.iv) {
return next();
}
@ -1617,6 +1617,8 @@ module.exports = async (
const GunEvent = Common.Constants.Event
const Key = require('../services/gunDB/contact-api/key')
const { timeout5 } = require('../services/gunDB/contact-api/utils')
app.get("/api/gun/lndchanbackups", async (req,res) => {
try{
const user = require('../services/gunDB/Mediator').getUser()
@ -1634,8 +1636,6 @@ module.exports = async (
const Events = require('../services/gunDB/contact-api/events')
const {timeout5} = require('../services/gunDB/contact-api/utils')
app.get(`/api/gun/${GunEvent.ON_RECEIVED_REQUESTS}`, (_, res) => {
try {
// spinup

View file

@ -89,7 +89,7 @@ const server = program => {
const authorized = Encryption.isAuthorizedDevice({ deviceId })
const encryptedMessage = authorized
? Encryption.encryptMessage({
message: args[0],
message: args[0] ? args[0] : {},
deviceId,
metadata: {
hash: dataHash