[Haskell-cafe] Re: RFC: A standardized interface between web servers and applications or frameworks (ala WSGI)

Adam Langley agl at imperialviolet.org
Sun Apr 13 23:27:35 EDT 2008


On Sun, Apr 13, 2008 at 6:32 PM, Chris Smith <cdsmith at twu.net> wrote:
>  Does old code that handled these headers stop working, just because it
>  was looking in the "other" section, but now needs to check a field
>  dedicated to that header?

Yes, but it would be very sad if we couldn't do common header parsing
because of this.

I'd suggest that all the headers given in RFC 2616 be parsed and
nothing else. That leaves the question of how we would handle the
addition of any extra ones in the future. Firstly, packages could
depend on a given version of this interface and we declare that the
set of handled headers doesn't change within a major version.

Better would be some static assertion that the interface doesn't
handle some set of headers. Maybe there's a type trick to do this, but
I can't think of one, so we might have to settle for a non static:

checkUnparsedHeaders :: [String] -> IO ()

Which can be put in 'main' (or equivalent) and can call error if
there's a mismatch.


AGL

-- 
Adam Langley agl at imperialviolet.org http://www.imperialviolet.org


More information about the Haskell-Cafe mailing list