Stumped as to where to go next with this issue.
My node.js azure function takes in a file represented as base64. It does some processing on the file and returns the processed file in the response:
module.exports = async function (context, req) {
const buf = Buffer.from(req.body.file, 'base64')
/// do processing
const file = filebuf.toString('base64')
context.res.status(200).json({ file })
}
So in my personal Azure tenant this works fine. In my clients azure tenant, the file is corrupted. This is with the same exact file as input.
Not sure if its interesting but the first few bytes of the different tenants processed files are as so:
{
"file": "UEsDBAoAAAAAAGh+r1SoFh7uRAwAAEQMAAA..."
}
{
"file": "UEsDBAoAAAAAANh8r1SoFh7uRAwAAEQMAAA..."
}
For some reason, around the 14th char is different and I can't think why that would be. Both function apps are running on Linux and the runtime version of the apps are the same.
Thanks
EDIT:
Following the first answer and my new understanding that the different byte is to be expected I am still not closer to understanding why one file is corrupt and another is not.
I now notice that the content length of the body is different:
Non-corrupt:
"headers":{"Transfer-Encoding":"chunked","Vary":"Accept-Encoding","Strict-Transport-Security":"max-age=31536000; includeSubDomains","x-ms-apihub-cached-response":"true","x-ms-apihub-obo":"true","Cache-Control":"private","Date":"Mon, 16 May 2022 08:25:38 GMT","Content-Type":"application/json; charset=utf-8","Content-Length":"2926356"}
Corrupt:
"headers":{"Transfer-Encoding":"chunked","Request-Context":"appId=cid-v1:XXX","x-ms-apihub-cached-response":"true","x-ms-apihub-obo":"true","Date":"Mon, 16 May 2022 08:24:48 GMT","Content-Type":"application/json; charset=utf-8","Content-Length":"2926368"}
Where could these extra bytes have come from? I wondering if it might be between different versions of Node but would be surprised.