-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct mime types for json subjects #210
Comments
We'll need to think about how best to implement this. Presumably we'll need to check the filenames for a I think we have three options:
What do people think? |
The problem files for the TESS project have a |
I think option 1 the better option then falling back to libmagic if it's installed. Looks like |
I’ve run into this again today for SLSN. My workaround is to explicitly set the MIME type and file contents (apologies for my terrible Python): subject.locations.append('application/json')
json_data = open('data/subject-1234.json', 'rb')
subject._media_files.append(json_data.read())
json_data.close() |
This same problem also occurs with |
The Python CLI uses |
The TESS project should be using json files as one of their subject locations, with a json file extension and a mime type of
application/json
. Currently libmagic is not correctly detecting these file types and staging subjects have been uploaded as txt files with a mime type oftext/plain
.We can set workflow configs to load a particular subject viewer, but I still would like to do validation on the expected json structure so we don't attempt to render something that has something wrong with its data. We typically expect text file subjects to be rendered just as plain text and are typically transcription projects, not data that should be plotted.
The text was updated successfully, but these errors were encountered: