From: Lars Olsson <lasso@lassoweb.se>
To: rack-devel@googlegroups.com
Subject: Suggestion: Uppercase extensions should be downcased
Date: Sat, 20 Jun 2009 12:27:04 +0200 [thread overview]
Message-ID: <4A3CB978.6000100@lassoweb.se> (raw)
Hello!
While working with some files created on Windows in Ramaze i discoved
that the web server returned the wrong content-type in some cases. I
tracked this down to the mime_type function in rack.
(from file rack/lib/rack/mime.rb)
def mime_type(ext, fallback='application/octet-stream')
MIME_TYPES.fetch(ext, fallback)
end
This gives me trouble when the file extension includes uppercase letters
as nothing in MIME_TYPES is matching. I think the code should be changed to:
def mime_type(ext, fallback='application/octet-stream')
MIME_TYPES.fetch(ext.downcase, fallback)
end
which makes extensions like .JPG work again.
Sincerely yours
/lasso
--
________________________________________
Lars Olsson
lasso@lassoweb.se
http://www.lassoweb.se/
next reply other threads:[~2009-06-20 14:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-20 10:27 Lars Olsson [this message]
2009-06-23 13:45 ` Suggestion: Uppercase extensions should be downcased Michael Fellinger
2009-06-23 18:40 ` Lars Olsson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://groups.google.com/group/rack-devel
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A3CB978.6000100@lassoweb.se \
--to=rack-devel@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).