viatropos/tower — pull request #129 by edubkendo (2012-05-02 05:17:41+00:00)
Title: Fixes @params.format problem in Tower.Controller.Instrumentation

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.

Hope this is helpful, and that I did it correctly this time. Sorry still getting the hang of all this.