cdgriffith / puremagic

Pure python implementation of identifying files based off their magic numbers
MIT License
161 stars 34 forks source link

Reset stream cursor after read #42

Closed Gr3atWh173 closed 1 year ago

Gr3atWh173 commented 1 year ago

I was facing this weird issue where downloading a previously uploaded PDF resulted in chrome complaining about not being able to open the document. Figured out what the actual issue was after comparing the original to the downloaded file which was missing the initial %PDF-. Manually resetting the stream worked but it would be nice to have puremagic do this automatically.