From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.204.72.79 with SMTP id l15cs305732bkj; Tue, 23 Jun 2009 06:46:24 -0700 (PDT) Received-SPF: pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.100.8.4 as permitted sender) client-ip=10.100.8.4; Authentication-Results: mr.google.com; spf=pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.100.8.4 as permitted sender) smtp.mail=grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com; dkim=pass header.i=grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com Received: from mr.google.com ([10.100.8.4]) by 10.100.8.4 with SMTP id 4mr142758anh.20.1245764783718 (num_hops = 1); Tue, 23 Jun 2009 06:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:received:x-sender:x-apparently-to :received:received:received-spf:authentication-results:received :dkim-signature:domainkey-signature:mime-version:received :in-reply-to:references:from:date:message-id:subject:to:content-type :content-transfer-encoding:reply-to:sender:precedence:x-google-loop :mailing-list:list-id:list-post:list-help:list-unsubscribe :x-beenthere-env:x-beenthere; bh=XyfOKivARt+6a6ERInmdhTxP40KdAFVOIG9o/CyIMGQ=; b=6f6+1buiXv/V6yW+Kv/ilwnRJfZG9rIrr1c4tcvCIU8N6D3On3IKwfjTVrahLd7k4N IGVE6d3/0Jg3EySKjEuykFPNB/e2c69wjcpcC3ng4i+6EboSPxD2IZm3VORi1pkIpFy2 3UhaIMpKaG7nFZi+/GJqO+v3FvLKMCh7cUpyo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-sender:x-apparently-to:received-spf:authentication-results :dkim-signature:domainkey-signature:mime-version:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding:reply-to:sender:precedence:x-google-loop :mailing-list:list-id:list-post:list-help:list-unsubscribe :x-beenthere-env:x-beenthere; b=Xgg93HChWsYpZsPZ5d/NeAKXRoQDXRdsOEIaWNr0kiE4SuIOGFeRDT8UYvfb8gVBMf 7bTfFKurqHKgLp0/9FOC1wXNuNUcZ+HbqumbLI/Oaf5WoahDVbmYDg7yBDfHjmy5APfp T1KOh+Sgfx8NtlWPEwxWHgWchxE4lnZbSkmiM= Received: by 10.100.8.4 with SMTP id 4mr19800anh.20.1245764783457; Tue, 23 Jun 2009 06:46:23 -0700 (PDT) Received: by 10.177.16.10 with SMTP id t10gr1465yqi.0; Tue, 23 Jun 2009 06:46:15 -0700 (PDT) X-Sender: m.fellinger@gmail.com X-Apparently-To: rack-devel@googlegroups.com Received: by 10.142.169.4 with SMTP id r4mr6457wfe.16.1245764774162; Tue, 23 Jun 2009 06:46:14 -0700 (PDT) Return-Path: Received: from mail-px0-f201.google.com (mail-px0-f201.google.com [209.85.216.201]) by gmr-mx.google.com with ESMTP id 20si11216pxi.8.2009.06.23.06.46.13; Tue, 23 Jun 2009 06:46:13 -0700 (PDT) Received-SPF: pass (google.com: domain of m.fellinger@gmail.com designates 209.85.216.201 as permitted sender) client-ip=209.85.216.201; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of m.fellinger@gmail.com designates 209.85.216.201 as permitted sender) smtp.mail=m.fellinger@gmail.com; dkim=pass (test mode) header.i=@gmail.com Received: by pxi39 with SMTP id 39so48921pxi.6 for ; Tue, 23 Jun 2009 06:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=PbxcS3o5DT5XwfnBi2BiIp9bqdjShCzb/S+2IoO23cg=; b=q4vs1ZuxdP4x7A+ClOdc/vomYvvM59BbmHj3AsoY/MXWQ5LLLl8HFO2/j5o8WCZa4h esmNZpYnnYBrorCH316S5HV3c4VVCZI4CBdanRPQp5Se46rNFjE3xx2LICRBDAtDk54B U5v3PSWOHwYC0YZgA+ReN28dpojf2esvyEAUY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=D5mzVH12axyLlH86Vj+OPZ8FVlV2u1WU2T2B9L3h9DRAj+o51bFfV8y4+509bCkF5A 392NoOvgfIikaGfHDWJC5Bd6ygvz1Gx6P6Ex+zZCD2v8vrQ2uHxFTaCNYUWP24Nm+5q9 1zSalREUyVG5KrPckF8coB6iPNtKIdSRL9oNE= MIME-Version: 1.0 Received: by 10.142.49.20 with SMTP id w20mr35398wfw.9.1245764773070; Tue, 23 Jun 2009 06:46:13 -0700 (PDT) In-Reply-To: <4A3CB978.6000100@lassoweb.se> References: <4A3CB978.6000100@lassoweb.se> From: Michael Fellinger Date: Tue, 23 Jun 2009 22:45:53 +0900 Message-ID: <9c00d3e00906230645p7249dc2el24783433d5820be3@mail.gmail.com> Subject: Re: Suggestion: Uppercase extensions should be downcased To: rack-devel@googlegroups.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Reply-To: rack-devel@googlegroups.com Sender: rack-devel@googlegroups.com Precedence: bulk X-Google-Loop: groups Mailing-List: list rack-devel@googlegroups.com; contact rack-devel+owner@googlegroups.com List-Id: List-Post: List-Help: List-Unsubscribe: , X-BeenThere-Env: rack-devel@googlegroups.com X-BeenThere: rack-devel@googlegroups.com On Sat, Jun 20, 2009 at 7:27 PM, Lars Olsson 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=3D'application/octet-stream') > =C2=A0 =C2=A0MIME_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=3D'application/octet-stream') > =C2=A0 =C2=A0MIME_TYPES.fetch(ext.downcase, fallback) > end > > which makes extensions like .JPG work again. OK, pushed a patch for that. -- ^ manveru