diff --git a/src/services/miiverse-api/routes/post.js b/src/services/miiverse-api/routes/post.js index ca11e06..eb2963a 100644 --- a/src/services/miiverse-api/routes/post.js +++ b/src/services/miiverse-api/routes/post.js @@ -26,7 +26,7 @@ router.post('/', upload.none(), async function (req, res, next) { let painting_uri = ""; if (req.body.painting) { painting = req.body.painting.replace(/\0/g, "").trim(); - painting_uri = util.data.processPainting(painting); + //painting_uri = util.data.processPainting(painting); } let screenshot = ""; if (req.body.screenshot) { @@ -65,6 +65,9 @@ router.post('/', upload.none(), async function (req, res, next) { catch (e) { console.error(e); + } + finally + { res.set("Content-Type", "application/xml"); res.statusCode = 400; response = { diff --git a/src/util/authentication.js b/src/util/authentication.js index e6ffece..4077ad3 100644 --- a/src/util/authentication.js +++ b/src/util/authentication.js @@ -122,25 +122,5 @@ let methods = { return decryptedBody; }, - processPainting: function (painting) { - let paintingBuffer = Buffer.from(painting, 'base64'); - let output = ''; - try - { - output = pako.inflate(paintingBuffer); - } - catch (err) - { - console.log(err); - } - let tga = new TGA(Buffer.from(output)); - let png = new PNG({ - width: tga.width, - height: tga.height - }); - png.data = tga.pixels; - let pngBuffer = PNG.sync.write(png); - return `data:image/png;base64,${pngBuffer.toString('base64')}`; - }, }; exports.data = methods;