Refactor: extract shared image upload utilities into bincio/shared/images.py
ALLOWED_IMAGE_TYPES, MAX_IMAGE_BYTES, and unique_image_name() were duplicated identically in both the edit and serve servers. Centralising them means a single change point for any future extension (e.g. adding image/avif support). Tests added in tests/test_shared_images.py cover no-collision, single and chained collisions, no-suffix filenames, and constant values.
This commit is contained in:
Reference in New Issue
Block a user