rolled back some web.olv changes to fix authentication

This commit is contained in:
CaramelKat 2020-05-10 04:55:48 -05:00 committed by jay.poff@outlook.com
parent bfd7ed66d8
commit f480ab79a5
2 changed files with 4 additions and 21 deletions

View File

@ -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 = {

View File

@ -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;