librelist archives

« back to archive

Changes To 0MQ Handler Protocol

Changes To 0MQ Handler Protocol

From:
Zed A. Shaw
Date:
2010-10-13 @ 08:40
Hi Everyone,

I've been banging out bugs like mad now that the buffer stuff is mostly
solved.  One that I *finally* fixed is the problem with cookies or any
other duplicated headers going to the handlers wrong.  What we had
before was that you'd get the header twice, so like this:

{"Duped": "1", "Duped": "2"}

Most json libraries will either barf (rare) or they'll give you a hash
with only one of these values.

What I've done now is that if there's a duplicated header it comes in as
a list:

{"duped": ["1","2"]}

Notice also that I am now canonicalizing headers like this:

* All headers from the browser are lowercased.
* Certain headers like x-forwarded-for and x-mongrel2-upload-* are
protected against the browser duping them to attack that way.
* All system headers (things parsed from the request like METHOD,
VERSION, etc) are upper cased.

This means that your libraries in most languages should just work right.
But let me know if this mixing of case is annoying or not.  It's really
fine to go either way so speak up and I'll change it.

Expect a fresh fairly solid release tomorrow.

-- 
Zed A. Shaw
http://zedshaw.com/