From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.140.141.15 with SMTP id o15cs305889rvd; Sat, 16 Jan 2010 05:22:38 -0800 (PST) Received: from mr.google.com ([10.100.201.1]) by 10.100.201.1 with SMTP id y1mr4598706anf.34.1263648157083 (num_hops = 1); Sat, 16 Jan 2010 05:22:37 -0800 (PST) Received: by 10.100.201.1 with SMTP id y1mr275892anf.34.1263648155395; Sat, 16 Jan 2010 05:22:35 -0800 (PST) X-BeenThere: rack-devel@googlegroups.com Received: by 10.213.39.202 with SMTP id h10ls834078ebe.2.p; Sat, 16 Jan 2010 05:22:34 -0800 (PST) Received: by 10.213.55.206 with SMTP id v14mr583565ebg.27.1263648154056; Sat, 16 Jan 2010 05:22:34 -0800 (PST) Received: by 10.213.55.206 with SMTP id v14mr583563ebg.27.1263648153960; Sat, 16 Jan 2010 05:22:33 -0800 (PST) Return-Path: Received: from mail-ew0-f222.google.com (mail-ew0-f222.google.com [209.85.219.222]) by gmr-mx.google.com with ESMTP id 17si107769ewy.11.2010.01.16.05.22.33; Sat, 16 Jan 2010 05:22:33 -0800 (PST) Received-SPF: neutral (google.com: 209.85.219.222 is neither permitted nor denied by best guess record for domain of ibc@aliax.net) client-ip=209.85.219.222; Received: by ewy22 with SMTP id 22so1925762ewy.39 for ; Sat, 16 Jan 2010 05:22:33 -0800 (PST) Received: by 10.213.41.81 with SMTP id n17mr1062536ebe.67.1263648153643; Sat, 16 Jan 2010 05:22:33 -0800 (PST) Return-Path: Received: from ibc-laptop.localnet ([212.230.46.89]) by mx.google.com with ESMTPS id 15sm2372879ewy.12.2010.01.16.05.22.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 16 Jan 2010 05:22:32 -0800 (PST) From: =?iso-8859-1?q?I=F1aki_Baz_Castillo?= To: rack-devel@googlegroups.com Subject: Re: Potential Rack-Contrib contributions Date: Sat, 16 Jan 2010 14:22:28 +0100 User-Agent: KMail/1.12.2 (Linux/2.6.28-16-generic; KDE/4.3.2; x86_64; ; ) References: In-Reply-To: MIME-Version: 1.0 Message-Id: <201001161422.28489.ibc@aliax.net> X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 209.85.219.222 is neither permitted nor denied by best guess record for domain of ibc@aliax.net) smtp.mail=ibc@aliax.net X-Original-Sender: ibc@aliax.net Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: X-Thread-Url: http://groups.google.com/group/rack-devel/t/c034955ef1a34475 X-Message-Url: http://groups.google.com/group/rack-devel/msg/1346047d4ec6aa36 Sender: rack-devel@googlegroups.com List-Unsubscribe: , List-Subscribe: , Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable El Viernes, 15 de Enero de 2010, Geoff Buesing escribi=F3: > * Rackables::DefaultCharset - Sets charset directive in Content-Type > header Hi, I'm inspecting DefaultCharset middleware: class DefaultCharset HAS_CHARSET =3D /charset=3D/ =20 def initialize(app, value =3D 'utf-8') @app =3D app @value =3D value end =20 def call(env) response =3D @app.call(env) headers =3D response[1] content_type =3D headers['Content-Type'] if content_type && content_type !~ HAS_CHARSET headers['Content-Type'] =3D "#{content_type}; charset=3D#{@value}" end response end end I see two issues here: 1) HAS_CHARSET =3D /charset=3D/ Note that HTTP grammar is case insensitive (in most of the cases) so IMGO i= t=20 shoud be: HAS_CHARSET =3D /charset=3D/i 2) content_type =3D headers['Content-Type'] Perhaps I'm wrong, but what about if the response headers created by other= =20 middleware or Rack app uses "content-type" or "CONTENT-type"? again RFC 261= 6=20 BNF grammar is case insensitive by default. However in case 2 perhaps I'm wrong as I don't know if Rack require some ex= act=20 format for headers name into generated responses. Regards. =2D-=20 I=F1aki Baz Castillo