commit
45d59e5581
1 changed files with 19 additions and 11 deletions
|
|
@ -3158,8 +3158,9 @@ module.exports = async (
|
||||||
ap.get('/api/gun/otheruser/:publicKey/:type/:path', async (req, res) => {
|
ap.get('/api/gun/otheruser/:publicKey/:type/:path', async (req, res) => {
|
||||||
const allowedTypes = ['once', 'load', 'open']
|
const allowedTypes = ['once', 'load', 'open']
|
||||||
const publicKeyForDecryption = req.header(PUBKEY_FOR_DECRYPT_HEADER)
|
const publicKeyForDecryption = req.header(PUBKEY_FOR_DECRYPT_HEADER)
|
||||||
const { path, publicKey, type } = req.params
|
const { path /*:rawPath*/, publicKey, type } = req.params
|
||||||
|
console.log(path)
|
||||||
|
// const path = decodeURI(rawPath)
|
||||||
if (!publicKey || publicKey === 'undefined') {
|
if (!publicKey || publicKey === 'undefined') {
|
||||||
res.status(400).json({
|
res.status(400).json({
|
||||||
errorMessage: 'Invalid publicKey specified'
|
errorMessage: 'Invalid publicKey specified'
|
||||||
|
|
@ -3173,7 +3174,7 @@ module.exports = async (
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
res.status(200).json({
|
res.status(200).json({
|
||||||
data: await handleGunFetch({
|
data: await handleGunFetch({
|
||||||
path,
|
path,
|
||||||
|
|
@ -3183,6 +3184,13 @@ module.exports = async (
|
||||||
publicKeyForDecryption
|
publicKeyForDecryption
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
} catch (err) {
|
||||||
|
res
|
||||||
|
.status(err.message === Common.Constants.ErrorCode.NOT_AUTH ? 401 : 500)
|
||||||
|
.json({
|
||||||
|
errorMessage: err.message
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
ap.post('/api/lnd/cb/:methodName', (req, res) => {
|
ap.post('/api/lnd/cb/:methodName', (req, res) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue