mikekelly / hal-browser

An API browser for the hal+json media type
MIT License
835 stars 157 forks source link

Fixed javascript error when 'content-type' header hasn't been set. #26

Closed col closed 10 years ago

col commented 10 years ago

The jQuery AJAX method sometimes returns a error response with an empty body and a status code of 0. This only really occurs when the url is unreachable but the hal-browser javascript currently crashes as it expects all responses to have the 'content-type' header set.

This change simple handles responses without a 'Content-Type' a little better and displays the response body on the page rather than showing nothing at all.

mikekelly commented 10 years ago

:+1:

nice one, thanks a bunch