How is the image sent back to the front end

System Information
  • Strapi Version: 3.6.8
  • Operating System: linux
  • Database: sqlite
  • Node Version: 14
  • NPM Version: 6.x
  • Yarn Version:

I am running strapi from Lambda and it all works pretty well except from images… I can upload them fine, but when i download them, they are corrupted. Can anyone point me to the code that sends image content down to the wire please? Here is how the 2 files look: the left one is not even marked as a jpeg file:

I’ve isolated the piece of code that returns the image (from strapi-plugin-upload/middlewares/upload/index.js):

      koaStatic(staticDir, { defer: true, ...localServerConfig })

Can anyone explain what range does? If i console.log it, it returns an object containing request, response (with a status of 404 and message ‘not found’…)

Also, taking away koaStatic does not seem to have any effect on the returned image.

My objective is to manipulate the Buffer until the correct format is sent back. Any idea?