From: "Iñaki Baz Castillo" <ibc@aliax.net>
To: rack-devel@googlegroups.com
Subject: Re: Potential Rack-Contrib contributions
Date: Sat, 16 Jan 2010 14:38:53 +0100 [thread overview]
Message-ID: <201001161438.53304.ibc@aliax.net> (raw)
In-Reply-To: <201001161422.28489.ibc@aliax.net>
El Sábado, 16 de Enero de 2010, Iñaki Baz Castillo escribió:
> 1) HAS_CHARSET = /charset=/
> Note that HTTP grammar is case insensitive (in most of the cases) so IMGO
> it shoud be:
>
> HAS_CHARSET = /charset=/i
Humm, definitively it's not enough. HTTP BNF grammar is really more complex
that the above hyper simplified assumption.
The folllowing headers are all valid "Content-Type" headers, and all of them
contain a valid "charset" param (replace <LF> with a real \r symbol and <TAB>
with \t):
Content-Type: text/plain ; CharSet<LF>
= utf-8
content-TYPE:text/plain ; CharSet<LF>
= utf-8
Content-Type: text/plain <LF>
; CharSet <LF>
= utf-8
Content-Type:<TAB><TAB>text/plain<TAB>; <LF>
charset <LF>
<TAB><TAB> <TAB> = <TAB><LF>
utf-8
Well for sure we can assume that other Rack middlewwares and also our Rack app
would generate a simple inline header value. Then I would rewrite the regex to
this one (the ";" is important):
HAS_CHARSET = /;[\s\t]*charset[\s\t]*=[\s\t]*/i
Regards.
--
Iñaki Baz Castillo <ibc@aliax.net>
next prev parent reply other threads:[~2010-01-16 13:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-15 16:23 Potential Rack-Contrib contributions Geoff Buesing
2010-01-16 12:29 ` Ryan Tomayko
2010-01-16 13:22 ` Iñaki Baz Castillo
2010-01-16 13:38 ` Iñaki Baz Castillo [this message]
2010-01-16 14:01 ` Michael Fellinger
2010-01-16 14:47 ` Iñaki Baz Castillo
2010-01-16 17:47 ` Geoff Buesing
2010-01-17 18:32 ` Geoff Buesing
2010-01-17 19:15 ` Geoff Buesing
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=201001161438.53304.ibc@aliax.net \
--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).