Callback functions not invoked for failed JSONP API requests #2169

neocotic opened this Issue Nov 22, 2016 · 1 comment


None yet

2 participants


The problem that I'm having is that when a JSONP request fails, YOURLS is setting the HTTP status code accordingly. Unfortunately, most browsers will not bother evaluating and processing JavaScript within the response body of a resource that failed to load, which makes sense really.

I think that it would be best that the API simply always returned HTTP status code 200 for all JSONP requests. Then it's the responsibility of the consumer to check the response for the errorCode etc.

ozh commented Nov 24, 2016

So, regular HTTP error codes for standard API requests, but 200 OK for all JSONP? Yes indeed. Makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment