-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need to check that response has not been already sent in phalcon/mvc/micro.zep #12668
Conversation
It is not possible to return a string value from a mapped function for an HTTP Method, and then catch that returned value by using Micro::getReturnedValue() method inside handler on Micro::after($handler), its overriding my response.
This is bug fix. |
Changelog updated. Since I could not install zephir on macox sierra, I could not tested. |
I mean unit test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fabsolute In general I like this PR. Could you please provide a small test which covers these changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FILE: /home/travis/build/phalcon/cphalcon/tests/unit/Mvc/MicroTest.php
----------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 4 LINES
----------------------------------------------------------------------
451 | ERROR | [x] Expected 1 space after USE keyword; found 0
| | (Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterUse)
451 | ERROR | [x] Expected 1 space before opening brace; found 0
| | (Squiz.Functions.MultiLineFunctionDeclaration.SpaceBeforeBrace)
458 | ERROR | [x] Expected 1 space before opening brace; found 0
| | (Squiz.Functions.MultiLineFunctionDeclaration.SpaceBeforeBrace)
459 | ERROR | [x] Line indented incorrectly; expected at least 24
| | spaces, found 23
| | (Generic.WhiteSpace.ScopeIndent.Incorrect)
467 | ERROR | [x] The closing brace for the class must go on the next
| | line after the body
| | (PSR2.Classes.ClassDeclaration.CloseBraceAfterBody)
----------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------
tests/unit/Mvc/MicroTest.php
Outdated
return "success"; | ||
} | ||
); | ||
$app->handle("/api"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect($micro->handle('/api'))->equals("success"); //❓
e6df98e
to
526d7bb
Compare
4d3c73f
to
6ef079c
Compare
Fixed in the |
Hello!
In raising this pull request, I confirm the following :
Small description of change:
It is not possible to return a string value from a mapped function for an HTTP Method, and then catch that returned value by using Micro::getReturnedValue() method inside handler on Micro::after($handler), its overriding my response.
Thanks