Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

JsonResponder and TwigResponder don't respect status set in payload #2

Closed
dropdevcoding opened this issue Jul 8, 2016 · 2 comments · Fixed by #5
Closed

JsonResponder and TwigResponder don't respect status set in payload #2

dropdevcoding opened this issue Jul 8, 2016 · 2 comments · Fixed by #5
Labels
Milestone

Comments

@dropdevcoding
Copy link
Contributor

In JsonResponder the status set in payload is not respected, since it's implemented like that:

return $response->withStatus(200);

This should be fixed by using the same logic used in other responders:

$status = $payload->getStatus() ?: 200;
return $response->withStatus($status);
@shochdoerfer
Copy link
Member

Good catch!

@dropdevcoding
Copy link
Contributor Author

I recently detected the same problem in TwigResponder

@dropdevcoding dropdevcoding changed the title JsonResponder does not respect status set in payload JsonResponder and TwigResponder don't respect status set in payload Aug 8, 2016
dropdevcoding added a commit that referenced this issue Aug 8, 2016
fixed TwigResponder to respect status code set in domainpayload
added unittests for fixes
fixes #2
@dropdevcoding dropdevcoding mentioned this issue Aug 8, 2016
@shochdoerfer shochdoerfer added this to the 0.2.0 milestone Aug 9, 2016
dropdevcoding added a commit to dropdevcoding/adrenaline that referenced this issue Jan 8, 2017
fixed TwigResponder to respect status code set in domainpayload
added unittests for fixes
fixes bitExpert#2
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants