rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: Michael Fellinger <m.fellinger@gmail.com>
To: rack-devel@googlegroups.com
Subject: Re: Suggestion: Uppercase extensions should be downcased
Date: Tue, 23 Jun 2009 22:45:53 +0900	[thread overview]
Message-ID: <9c00d3e00906230645p7249dc2el24783433d5820be3@mail.gmail.com> (raw)
In-Reply-To: <4A3CB978.6000100@lassoweb.se>


On Sat, Jun 20, 2009 at 7:27 PM, Lars Olsson<lasso@lassoweb.se> wrote:
>
> 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.

OK, pushed a patch for that.

--
^ manveru

  reply	other threads:[~2009-06-23 13:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-20 10:27 Suggestion: Uppercase extensions should be downcased Lars Olsson
2009-06-23 13:45 ` Michael Fellinger [this message]
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=9c00d3e00906230645p7249dc2el24783433d5820be3@mail.gmail.com \
    --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).