Skip to content

RestApiHandler not returning a Rhubarb response object#22

Merged
acuthbert merged 4 commits into
v3from
feature/FixForRequestReturningInvalidResponse
Jan 30, 2019
Merged

RestApiHandler not returning a Rhubarb response object#22
acuthbert merged 4 commits into
v3from
feature/FixForRequestReturningInvalidResponse

Conversation

@miscampbell

Copy link
Copy Markdown

This fixes an issue where the middleware layer was returning a valid response object but we were ignoring it and always returning a JsonResponse object. The example of the issue this fixes is on login the TokenAuthenticationMiddleware that validates your login was returning a TokenAuthorisationRequiredResponse object which we never returned.

The content of this response was not being adhered to and we were defaulting it to a standard JsonResponse object.

@miscampbell miscampbell requested a review from acuthbert January 30, 2019 10:45
@samnotsowise

Copy link
Copy Markdown
Contributor

@miscampbell the middleware response is returned before (line 149) the endpoint response is generated. Is your middleware registered correctly?

…because any put request should specify the id to update in the url
{
$resource = $this->get($params, $request);

if ($resource->id != $payload["id"]){

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

absolutely

@acuthbert acuthbert merged commit 99db573 into v3 Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants