Bad Request/Bad URI on production (Heroku) but not locally <p>Let me preface this by saying most of this application is a giant hack put together in a short window of time under pressure so I may have deeper issues. This question will likely have some bad code in it.</p> <p>I've built a Sinatra application to handle some tasks with purchase and sales orders in-house. Part of that is to send a few parameters to one of the routes in the app which will then push those off to an API that does useful things with them.</p> <p>Right now, I'm generating the links with paramaters from within a pretty ugly loop in HAML:</p> <pre><code> %td - opts = JSON.generate({ "key" =&gt; d[d.keys.first]["key"], "sa_id" =&gt; d.keys.first, "site" =&gt; d[d.keys.first]["site"], "name" =&gt; d[d.keys.first]["name"], "recipient" =&gt; d[d.keys.first]["email"], "items" =&gt; d[d.keys.first]["descriptions"], "date" =&gt; d[d.keys.first]["ship_date"]}) -if (d[d.keys.first]["email"]) &amp;&amp; (d[d.keys.first]["site"] != "") %a{:href =&gt; "/notify?options=#{opts}", :title =&gt; "Deliver"} Deliver -else Deliver %a{:href =&gt; "/destroy?key=#{d.keys.first}", :title =&gt; "Destroy"} Destroy </code></pre> <p>When clicking hte "deliver" link (<code>%a{:href =&gt; "/notify?options=#{opts}", :title =&gt; "Deliver"} Deliver</code>) locally, everything behaves as expected. My <code>/notify</code> route is called, it hands the parameters off to the desired API, and everything is rainbows and unicorns. When I click that same link on Heroku, it throws a "Bad Request" stating "Bad URI". The <em>only</em> difference between the two URLs generated is the hostname (localhost:3000 vs. myapp.herokuapp.com) and vimdiff confirms this.</p> <p>Everything else being even, why would Heroku (using Webrick) kick back my URI when my local instance (Thin) doesn't seem to care?</p>