[web-devel] Proposal: http-types
cjs at starling-software.com
Thu Feb 3 13:30:08 CET 2011
On 2011-02-02 16:43 +0100 (Wed), Johan Tibell wrote:
> Are you sure that no headers are defined as octets (i.e. binary data).
> If some are they will have all 8 bits set possibly.
Some are indeed so. See, e.g., comments in HTTP headers (RFC2616 section
2.2), which are 'ctext' surrounded by parens; ctext is 'any TEXT
excluding "(" and ")"'; TEXT is 'any OCTET except CTLs...', and OCTET is
'any 8-bit sequence of data.'
That said, there is no method within the standard to specify the
encoding of anything, so stuff like that needs to be treated as more or
less opaque binary data, anyway.
It's not clear to me how the Host: header interacts with I18N domain
names, but I guess you just use the canonical ASCII form and the
strictures about doing a "case-insensitive" comparison count only for
the ASCII characters in that form. (Probably one wants to include these
sorts of comparison functions in the API.)
Another issue to think about is that many interface specifications
between web servers and things that deal with web requests don't
use HTTP headers; they use a very ill-specified "CGI environment
variables" thing instead, and the translation between HTTP headers and
that is generally "defined" (if I dare even to use that word) by the
particular web server implementation. (This is more or less the bane
of my existence when I put on my "web developer" or "web framework
developer" hat.) It would pay to be clear about just how this library
and that very common use case interact.
Curt Sampson <cjs at cynic.net> +81 90 7737 2974
"There's a war between the ones who say there is a war
and the ones who say there isn't." --Leonard Cohen
More information about the web-devel