-
Notifications
You must be signed in to change notification settings - Fork 85
"Invalid status code provided" while processing the Http Response #178
Comments
That's not a helpful way to report issues: if you have a problem, send a patch with a test case, but writing "it should zomg why no fix yet?!" is not going to make you a lot of friends in OSS projects. I'm pretty sure that we should not support anything above 599 anyway though, as |
Hi Ocramius Thanks for reading. I'm more than happy to submit a patch for this. But first I need the approvers to agree on a design or expected results. |
Ok. No response from any maintainer. Good thing is I did not fix anything. This seems to be abandonware. I will stop using zend-http, and as always try to get out of zend and PHP. |
Nice state of mind ... Maintainers have fulltime-job and family life, some are also involved in several open-source projects (like Ocramius; thanks for your job 👍 ) or go to events in the PHP community (as speakers or not).
Not strictly valid since HTTP code 520 itself is not documented by any of the HTTP specifications...
It's not a problem proper to Zend Framework nor PHP... |
Hi MadCat34, Let's try to solve this issue. zend-diactoros: https://github.com/zendframework/zend-diactoros/blob/9a4b4a3c78c1a65e6096fb1f37ab424f33c68821/src/Response.php#L170 zend-http: https://github.com/zendframework/zend-http/blob/master/src/Response.php#L280 We need to make zend-http behave exactly like zend-diactoros:
Please note, the standard defines ranges and some codes. But, from my understanding, it doesn't prohibit anything like 520 or 555. |
If you guys are willing to accept this change, I'm fine to write the code and few tests. |
The approach is fine: send a patch with a failing test case and the fix for it, and it will most likely be merged. Also, as @MadCat34 said, OSS is not my full-time job: I do this when I have time and the mood for it. |
@roypalacios Are you willing to submit your PR? |
Hi @webimpress, Yes, I can submit it in the next few days! |
Hello @webimpress @Ocramius @MadCat34 Please review the pull request -> #194 I have modified the code so that it behaves just as diactoros in this sense. zend-diactoros: https://github.com/zendframework/zend-diactoros/blob/9a4b4a3c78c1a65e6096fb1f37ab424f33c68821/src/Response.php#L170 If anything else is needed, please let me know. Roy |
Issue #27 should be reopened.
This is 2019 and we should not fail to parse a response just because the HTTP Status is not strictly standard.
Adding a custom HTTP status is not an option if we are dealing with external Http servers. In my case I'm getting a 520.
Code to reproduce the issue
Response.php
Expected results
Actual results
Zend-Http is able to understand "I'm a teapot" but unable to process LOTs of valid responses coming from a myriad of sources.
This really needs to be fixed. Otherwise people will accelerate the move out of Zend altogether.
Please let me know if you are willing to accept this issue, and need help implementing it.
The text was updated successfully, but these errors were encountered: