-
Notifications
You must be signed in to change notification settings - Fork 286
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
[script + doc] Update tar.bz2 mime type #140
Conversation
Thanks for your attention to detail. Some feedback: You use the word "perfectionist" numerous times in your post, yet I am not sure you understand what it means. If there is something that has a single correct answer and you can point me to the specification, then I will make those changes in lighttpd, if lighttpd is not already doing that single, right thing. If that is not the case, then "perfection" is at best a misleading way to describe your post. Maybe you meant "completionist"?
Yep. So why should I make any changes? (Serious question.) Do you have documentation to show that other choices provide better interoperability with existing (historical and current) clients? You have referenced XDG. BTW, regarding
The builtin-list of mime-types in configfile.c are not intended to be exhaustive and complete. They are intended to be common media types for web usage, as documented in the comment above the
If you are suggesting changes, then please document how your suggestions differ from the reference above, and provide references why your suggestions are better. Specifically, please highlight and provide references documenting where your choices provide better interoperability with existing (historical and current) clients. (I did not notice any primary sources, though you do provide references to XDG.) I am not an authority on mime-types and will not engage in any sort of debate on the matter. I do not claim that my choices are the best, though I have tried to make a solid attempt and have provided references which informed me. bzip2 compression for web pages from web servers never was a popular choice, and has since been supplanted by brotli and zstd as alternatives to gzip. Why should I make any changes for bzip2? bzip2 support in lighttpd mod_deflate is disabled by default and must be selected during build time if still desired. mimetype.assign wiki page config sample is old, created back in 2007.
These statements are false. Did you test this? Those statements may have been true prior to lighttpd 1.4.46 (released in 2017) with commit:0cc7556ae The sample has more than 16 entries, and so longest extension match is what is used since lighttpd 1.4.46.
Maybe I'll change that. Or maybe I'll remove bz2 from the sample config on that wiki page.
As noted above, that part of the wiki page was written back in 2007, when the type was application/x-gzip. I may simply remove most of the sample config in favor of a simpler example. |
I updated mimetype.assign wiki page config sample to remove the longer sample |
Short answer: no. As I wrote above, the builtin-list of mime-types in configfile.c are not intended to be exhaustive and complete. There needs to be a more convincing argument than "completionist" to add entries to the default mimetype.assign in |
Fedora
I will accept this change to create-mime.conf.pl since the original lines appear to be a typo and date back to 2014 according to the git history, and you have referenced that XDG recognizes
Please update this PR to remove changes to |
(thx ToMe25) x-ref: lighttpd#140
I am aware that "perfectionist" is not the 100% correct word, but since I wasn't able to remember the word I actually meant, still don't, and couldn't easily find it by googling, this was the closest I could get ;)
I believe you misunderstood me here. Edit: The reasoning behind this, what I called me being a perfectionist, is "If the default config supports this, shouldn't the default generation mime config do so as well?". |
My apologies, I was not aware of there being a different matching logic for longer configs, and only tested it with a subset of the example config.
As I already mentioned, I did not mean to suggest adding values to the c code, sorry about that. |
Of course. |
b51d235
to
39d9ad9
Compare
I rebased this PR on top of the current changes to master. If you'd like me to either regenerate the file |
Please remove those changes from the PR. The first line of that file indicates that it is generated from create-mime.conf.pl. Periodically, I manually regenerate it on a Fedora system. On the other hand, you manually edited the file in your patch. Please remove those changes from this PR.
Other than for historical reasons, the entries in
Please take the feedback that your prose is misleading and distracting from your message. It also is severely discrediting to your abilities. None of what you wrote or your behavior describes a perfectionist, so if you do understand what the word means, you should not have used the word even once to describe yourself or your actions in this PR. |
I'm aware, I wrote that comment on my phone and didn't notice what auto-correct did there.
I googled this again, and still do not agree with this statement.
I read that header, which is why I asked whether I should regenerate the file, or get rid of my changes.
Looking at multiple dictionary definitions of "completionist" I do not agree at all that this is what applies to this situation. After all my intention was never "to complete the collection to contain everything related", but "to ensure parity with another system as a minimal baseline". At this point I also wish to note that me being the way I am, to avoid using any specific wording, was only my motivation. My reasoning for why this change might be worth including was instead, that I thought a script that generates a replacement for the built-in defaults generating a config that reduces support in some aspect, on a major distro, might be considered less than ideal. Anyway, I didn't mean to write that much about the exact meaning of words. Oh, one last note: By perfectionist I do not mean "One who believes being perfect as a person is achievable", but "One who gets annoyed at even minor imperfections". |
* Unify the content type of gzip compressed tars to application/x-gtar-compressed * Unify the content type of bzip2 compressed tars to application/x-bzip-compressed-tar Exact reasoning will be provided in the PR.
39d9ad9
to
0b0b24c
Compare
I updated the commit in this PR to no longer contain the changes to |
Despite having read your initial comment multiple times, I seem to have failed to respond to this part. What I meant to convey instead is that the perceived inconsistencies( This is how people in most communities I spent significant amounts of time in seemed to have used wording like "I'm a perfectionist about these things", and so I, possibly incorrectly, assumed that this was what would be conveyed when I used similar wording. |
I wrote:
Unfortunately, you missed the message and come across to me as extremely immature trying to use lots of words to justify your previous words. Sometimes you should just take the note. I wrote that I will accept the suggested to changes to create-mime.conf.pl and provided two reasons why:
|
As you noted in your original post, Fedora /etc/mime.types provides .tgz mapping to application/gzip As I regenerate |
Thanks for accepting this PR. |
Changes
Reasoning
Unfortunately the MIME types used for compressed tars vary quite a lot.
Below this I am trying to detail the pros and cons of the various MIME types I found being used, as well as my reasoning for choosing the ones I ultimately chose.
I looked at the default mime.types files for Debian, Fedora, OpenBSD, and Apache.
I also just googled around for a while and looked at lots of projects, of which I remember far too few to list them here, to get a rough feeling for which MIME types are used how much.
I also looked at xdg-shared-mime-info to see what they use.
Finding projects containing their own tar.bz2 mappings was pretty challenging, so I don't have much data to base my usage guesses on.
I still tried my best regardless, but the result may not be perfect.
Gzip
application/gzip
Pros
Cons
application/x-gtar-compressed
(Used in this PR)Pros
Cons
application/x-tgz
Pros
Cons
application/x-compressed-tar
Pros
Cons
Bzip2
application/x-bzip2
Pros
Cons
application/x-gtar-compressed
Pros
Cons
application/x-bzip-compressed-tar
(Used in this PR)Pros
Cons
application/x-bzip2-compressed-tar
Pros
Cons
application/x-bzip-compressed-tar
Related question and notice
Wiki Page
The mimetype.assign wiki page config sample contains a few minor issues related to compressed tars.
These aren't important enough for me to want to learn to use redmine and create an account to edit the lighttpd wiki because of it.
But I still thought I should mention them somewhere, so here they are.
application/x-gzip
application/x-bzip
application/x-bzip
, despite all of the mime.types files I checked, which contain bz2 at all, usingapplication/x-bzip2
. Those are Fedora, Apache, and XDG. Lighttpd also usesapplication/x-bzip2
by default.application/x-gzip
despite the officially registeredapplication/gzip
type now being registered for quite a while, and being more widely supported as far as I can tellapplication/x-tgz
, which seems to be relatively uncommon as far as I can tell.As a side note, this example already uses
application/x-bzip-compressed-tar
for bzip compressed tars.Future PR
The perfectionist in me wanted to check all the default types in configfile.c against the Debian and Fedora mime.types files and add those who are missing from one or both of those to useful_types.
I held back on that, because it would be out of scope for this PR, but I wanted to ask a few things about this: