Merge pull request #71 from shocknet/bug/no-data-error

Bug/no-data-error
This commit is contained in:
Daniel Lugo 2020-06-10 10:45:51 -04:00 committed by GitHub
commit 492cd39b61
2 changed files with 4 additions and 4 deletions

View file

@ -249,7 +249,7 @@ module.exports = async (
return res.status(401).json(error); 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(); return next();
} }
@ -1617,6 +1617,8 @@ module.exports = async (
const GunEvent = Common.Constants.Event const GunEvent = Common.Constants.Event
const Key = require('../services/gunDB/contact-api/key') const Key = require('../services/gunDB/contact-api/key')
const { timeout5 } = require('../services/gunDB/contact-api/utils')
app.get("/api/gun/lndchanbackups", async (req,res) => { app.get("/api/gun/lndchanbackups", async (req,res) => {
try{ try{
const user = require('../services/gunDB/Mediator').getUser() const user = require('../services/gunDB/Mediator').getUser()
@ -1633,8 +1635,6 @@ module.exports = async (
}) })
const Events = require('../services/gunDB/contact-api/events') 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) => { app.get(`/api/gun/${GunEvent.ON_RECEIVED_REQUESTS}`, (_, res) => {
try { try {

View file

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