anacronw / multer-s3

multer storage engine for amazon s3
MIT License
660 stars 190 forks source link

Fix SVG bug #141

Closed whizkid77 closed 3 years ago

whizkid77 commented 4 years ago

The bug:

  1. fileType will sometimes preemptively detect svg files as application/xml before isSvg is called. We want it to be more specific.
  2. isSvg requires inspecting the entire file contents, while fileType only requires the first chunk.

The solution:

  1. isSvg is more specific, so move it above the fileType call.
  2. Use the end event rather than data event for the file stream.
LinusU commented 3 years ago

Sorry that no one ever took a look at this 😢

This was addressed in #103