From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.140.141.15 with SMTP id o15cs306323rvd; Sat, 16 Jan 2010 05:39:02 -0800 (PST) Received: from mr.google.com ([10.101.151.37]) by 10.101.151.37 with SMTP id d37mr4596892ano.33.1263649142106 (num_hops = 1); Sat, 16 Jan 2010 05:39:02 -0800 (PST) Received: by 10.101.151.37 with SMTP id d37mr277307ano.33.1263649140429; Sat, 16 Jan 2010 05:39:00 -0800 (PST) X-BeenThere: rack-devel@googlegroups.com Received: by 10.213.62.209 with SMTP id y17ls288998ebh.1.p; Sat, 16 Jan 2010 05:38:59 -0800 (PST) Received: by 10.213.24.1 with SMTP id t1mr553890ebb.6.1263649139290; Sat, 16 Jan 2010 05:38:59 -0800 (PST) Received: by 10.213.24.1 with SMTP id t1mr553889ebb.6.1263649139266; Sat, 16 Jan 2010 05:38:59 -0800 (PST) Return-Path: Received: from ey-out-1920.google.com (ey-out-1920.google.com [74.125.78.146]) by gmr-mx.google.com with ESMTP id 11si245383ewy.9.2010.01.16.05.38.59; Sat, 16 Jan 2010 05:38:59 -0800 (PST) Received-SPF: neutral (google.com: 74.125.78.146 is neither permitted nor denied by best guess record for domain of ibc@aliax.net) client-ip=74.125.78.146; Received: by ey-out-1920.google.com with SMTP id 13so283936eye.4 for ; Sat, 16 Jan 2010 05:38:59 -0800 (PST) Received: by 10.213.0.220 with SMTP id 28mr625349ebc.49.1263649138672; Sat, 16 Jan 2010 05:38:58 -0800 (PST) Return-Path: Received: from ibc-laptop.localnet ([212.230.46.89]) by mx.google.com with ESMTPS id 13sm2386835ewy.13.2010.01.16.05.38.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 16 Jan 2010 05:38:57 -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:38:53 +0100 User-Agent: KMail/1.12.2 (Linux/2.6.28-16-generic; KDE/4.3.2; x86_64; ; ) References: <201001161422.28489.ibc@aliax.net> In-Reply-To: <201001161422.28489.ibc@aliax.net> MIME-Version: 1.0 Message-Id: <201001161438.53304.ibc@aliax.net> X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 74.125.78.146 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/8b0e3fc4ff5c8977 Sender: rack-devel@googlegroups.com List-Unsubscribe: , List-Subscribe: , Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable El S=E1bado, 16 de Enero de 2010, I=F1aki Baz Castillo escribi=F3: > 1) HAS_CHARSET =3D /charset=3D/ > Note that HTTP grammar is case insensitive (in most of the cases) so IMGO > it shoud be: >=20 > HAS_CHARSET =3D /charset=3D/i Humm, definitively it's not enough. HTTP BNF grammar is really more complex= =20 that the above hyper simplified assumption. The folllowing headers are all valid "Content-Type" headers, and all of the= m=20 contain a valid "charset" param (replace with a real \r symbol and =20 with \t): Content-Type: text/plain ; CharSet =3D utf-8 content-TYPE:text/plain ; CharSet =3D utf-8 Content-Type: text/plain ; CharSet =3D utf-8 Content-Type:text/plain; charset =3D utf-8 Well for sure we can assume that other Rack middlewwares and also our Rack = app=20 would generate a simple inline header value. Then I would rewrite the regex= to=20 this one (the ";" is important): HAS_CHARSET =3D /;[\s\t]*charset[\s\t]*=3D[\s\t]*/i Regards. =2D-=20 I=F1aki Baz Castillo