-
Notifications
You must be signed in to change notification settings - Fork 187
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
use magicmime #6869
use magicmime #6869
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
@aduffeck you had the idea to use the I found no way to use the |
@micbar i hijacked the pr 😗 |
@mmattel FYI, i've already added some information into the readme, fine? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions, rest looks good 👍
@mmattel could I request your magic on the docu parts? 🙏
Co-authored-by: Martin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM from a docs pov 👍
scanner := bufio.NewScanner(f) | ||
for scanner.Scan() { | ||
fields := strings.Fields(scanner.Text()) | ||
if len(fields) <= 1 || fields[0][0] == '#' { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure that len(fields[0]) >= 1
? Otherwise this will panic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussion we decided that we indeed are sure
Kudos, SonarCloud Quality Gate passed! 0 Bugs 38.7% Coverage The version of Java (11.0.17) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. |
Description
Getting a list of file extensions based on a mimetype is already possible in our rego files, the main downside till today was that the known range of mappings are limited.
This pr introduces the ability to provide a custom mime.types file to ocis and extend that store.
The format is based on https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types.
RFC 4288 provides more information.
Motivation and Context
The default mime.types file extension mapping is limited, we have to give the option to extend the list of known mappings.
How Has This Been Tested?
Types of changes
Checklist: