Comment 6 for bug 1871486

Revision history for this message
Daniel Manrique (roadmr) wrote :

ok, apologies, this does seem to all be store-centric. The store will NOT look at the incoming multipart form's mime type; rather it uses python-magic to determine file type by looking at the first 4096 bytes of the file.

This is in the devportal.forms.UpdateBinaryMetadataForm._detect_mime_type method.

I think snapcraft uses a different method of determining file type; another thing I found quickly poking at things is that python-magic 0.4.13 detects svg files as octet/stream or somesuch, not as svg. Python-magic 0.4.18, though, does detect correctly for the example given svg, even with only the first 4k of file.

So store-side:

1) update python-magic to 0.4.18
2) fix the awkward string to read more nicely :)