rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: Lars Olsson <lasso@lassoweb.se>
To: Rack Development <rack-devel@googlegroups.com>
Subject: Re: Suggestion: Uppercase extensions should be downcased
Date: Tue, 23 Jun 2009 11:40:26 -0700 (PDT)	[thread overview]
Message-ID: <ca6f34ca-bb3f-466c-999b-3ce4e859f1a8@3g2000yqk.googlegroups.com> (raw)
In-Reply-To: <9c00d3e00906230645p7249dc2el24783433d5820be3@mail.gmail.com>


On 23 Juni, 15:45, Michael Fellinger <m.fellin...@gmail.com> wrote:
> On Sat, Jun 20, 2009 at 7:27 PM, Lars Olsson<la...@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

Thanks!

/lasso

      reply	other threads:[~2009-06-23 19:08 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
2009-06-23 18:40   ` Lars Olsson [this message]

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=ca6f34ca-bb3f-466c-999b-3ce4e859f1a8@3g2000yqk.googlegroups.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).