mirror of
https://github.com/PretendoNetwork/miiverse-api.git
synced 2026-07-07 13:03:53 -05:00
rolled back some web.olv changes to fix authentication
This commit is contained in:
parent
bfd7ed66d8
commit
f480ab79a5
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user