Skip to content

v3: simplify mimetypes

luna requested to merge v3-simplify-upload-mimes into v3

closes #136 (closed).

  • remove usage of ctx.file.mime, always use libmagic's mimetype
  • add ctx.resolve_mime() go have a tuple containing mime and extension to use
  • make upload helper classes be dataclasses instead of namedtuples
  • use 1kB instead of 512 bytes for libmagic handover
  • add FORCE_EXTENSION so all files of a given mime go to a given extension (all jpeg images are .jpg)
  • add INCLUDE_EXTENSION so we can add our own extensions to specific mimes (any application/octet-stream files can have an empty extension)
  • ensure file stream is coherent when calculating hashes
  • remove some app parameters
Edited by luna

Merge request reports