Content-Type header mis-interpreted
mgeisler opened this issue · comments
When viewing the headers for a Gruntfile.js
file, it seems that we get too much data back from the HEAD call we do to read headers. The object has a application/json;charset=utf-8
Content-Type, and while we send a HEAD request, we get a response body back. Angular tries to interpret this as JSON and raises an error:
Error: JSON.parse: unexpected character at line 1 column 1 of the JSON data
The error is raised because the file has a /* ... */
comment and thus isn't valid JSON. However, the underlying problem is that
- We get a response body from our HEAD request
- We interpret the data in the response body though we only care about the HTTP headers when rendering the object detail page.