Skip to content
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

NGAS support multiple file extensions with the same mime-type #42

Open
smclay opened this issue Jan 28, 2021 · 2 comments
Open

NGAS support multiple file extensions with the same mime-type #42

smclay opened this issue Jan 28, 2021 · 2 comments

Comments

@smclay
Copy link
Contributor

smclay commented Jan 28, 2021

It would appear that NGAS only supports a single file extension per mime-type. It would be desirable if NGAS could support multiple files extensions with the same mime-type. For example bin, dat and exe could all be application/octet-stream, htm and html could be text/html.

@rtobar
Copy link
Contributor

rtobar commented Feb 3, 2021

@smclay I agree with the sentiment. After a quick browse through the code it seems that the one-to-one mapping between mime types and extensions is relied upon in quite a few places though, so my first guess is that it would take some effort to do this change correctly.

The current way to deal with multiple extensions that belong to the same logical "type" is to register them with slightly different mime types, and then register the same plug-in to act on all the different mime types. For example in the sample config file different mime types are defined for the fits, fits.gz and fits.Z extensions, but then they are all treated by the same archiving and processing plug-ins. I know it's not ideal, but it should suffice for most use cases.

@smclay
Copy link
Contributor Author

smclay commented Feb 3, 2021

I had a feeling it would not be trivial. Thank you for the explanation. Perhaps this is one for the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants