Yeah its annoying but i was working with another developer and they were
implementing something in phone-gap.

Apparently when they made jsonp requests and the response status code was a
non standard one eg. 422, the response body would be dropped.

Using a 200 ensured that the body was delivered. I havent had time to
verify this personally, so perhaps someone else can confirm / shed some
light on this edge case.





On Thu, May 22, 2014 at 9:38 PM, Jason Lewis <notifications@github.com>wrote:

> In src/Routing/Router.php:
>
> >  			$response = Response::makeFromExisting($response)->morph($this->requestedFormat);
> >  		}
> >
> > +		// Force the response to always return "200 OK"
> > +		// Chances are if the client is requesting jsonp their browser
> > +		// wont implement 422 etc and will drop the body
> > +		if ($this->requestedFormat == 'jsonp') {
> > +			if (!in_array($response->getStatusCode(), [404, 200])) {
> > +				$response->setStatusCode(200);
> > +			}
> > +		}
> > +
>
> Can you please explain this? Why is the response being forced to return as
> "200 OK"?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/dingo/api/pull/35/files#r12945612>
> .
>



-- 
Arnold Almeida
+61 432 149 788
arnold@floatingpoints.com.au

========================
Floating Points // Digital Direction
floatingpoints.com.au