viatropos/tower — pull request #128 by edubkendo (2012-05-02 03:30:44+00:00)
Title: Fixes @params.format problem as discussed in issue #107

As discussed in issue #107, line 65 in instrumentation.coffee doesn't work in certain situations such as submitting a form, and causes the redirect to hang, sending only a blank page. This solution is robust, and should catch yet unseen situations as well as the one mentioned in #107 . Very different from my earlier ideas, and more "correct". By using the request.headers["accept"] property in situations where there is one, instead of the request.header("content-type"), we get closer to what the page is actually asking for, while falling back on "content-type" in those situations where there is no "accept" property.