theodi/open-data-certificate — pull request #489 by pezholio (2013-08-09 10:07:16+00:00)
Title: Fix content negotiation issues

Fixes #483

There were two issues here, first was that sending an accept header to a page that didn't serve JSON would result in a 500 error, as Rails didn't have a template to serve. I've fixed this by adding `respond_to` blocks to each controller method which didn't have one already, as well as overriding the high_voltage stuff too.

The second issue was that if someone requests a page with an accept header, then the expectation would be for a `Content-Location` header to be sent that points to the specific URL for the format requested. I've fixed this by writing a bit of middleware to check if an extension has been given, and if it has, and we can get an extension for the MIME type that's requested, then send the specific URL.