Comments (12)
(Originally posted by: shevron on 02/08/12)
The right solution for this is that Zend\Http\Response (as well as Request and Client) should stop validating things like status codes, method names etc. using a white-list of possible values, and switch to using the rules specified in the HTTP RFC. The RFC does allow not only codes like 308 but basically any 3-digit custom status codes are allowed.
I am working to change these in my Zend\Http rewrite branch, but this branch also includes a host of other major changes so I do not consider it a fix for this bug, at least not until it is decided to fully merge this branch (if at all).
from zendframework.
This issue was ported from the ZF2 Jira Issue Tracker at
http://framework.zend.com/issues/browse/ZF2-156
Known GitHub users mentioned in the original message or comment:
@ralphschindler, @shevron
from zendframework.
@shevron do you still plan to merge your rewrite branch? I notice above you said if at all. If you do not plan to merge the branch let me know and I can start looking into fixing this.
from zendframework.
Sorry for the detaly. I am swamped at work in the forseeable future so I suggest that if you have a quick fix, fix it and don't wait for me. In any case my "fix" is a complete rewrite + BC breaks, so if we can fix it without that overhead, I think you should go for it.
from zendframework.
@jcrawford @shevron Can you add a link to the RFC where this status code is defined?
from zendframework.
@Maks3w I do not see it in the actual http rfc at all, they seem to stop at 307
from zendframework.
Then I suggest add HTTP 308 to Zend\Http as a generic code
from zendframework.
http://tools.ietf.org/html/draft-reschke-http-status-308-07
The draft has expired, but Appendix A has some links to implementations.
from zendframework.
@Maks3w @shevron @gwis I noticed the draft but it's not in the official RFC, should this be supported?
from zendframework.
@jcrawford the real bug here is not the lack of a constant for each HTTP status code out there, but that Http\Response blows up and throws an exception for a code it doesn't know.
The HTTP standard is extinsible - it allows any status codes to be used in addition to the ones documented in the RFC (this also goes for request methods, headers, etc.), and Http* classes should be just as flexible. They should accept syntactically valid codes (the RFC defines what is syntactically valid) and deny invalid ones (e.g. a status code made out of letters) but not blow up on a syntactically valid status code it does not know.
I would have fixed this myself, but I am really struggling with free time recently. If that's something you can patch, I think it would be great. Even better if we remove all the places where Zend\Http* classes throw an exception for a code / header / method / etc. it doesn't know, as long as the protocol allows it.
from zendframework.
@shevron thanks for the clarification I will see if I can get a fix submitted over the next few days.
from zendframework.
Does anyone want to produce a pull request for non-standard/extension http codes? If not, I suggest we close this as its a non-trival feature request.
from zendframework.
Related Issues (20)
- Class Methods Hydrator - data not properly populated if object gets bound to form HOT 1
- Db/Sql/Predicate/Expression changes in #6849 introduced a BC break HOT 1
- SMTP SSL Error HOT 1
- Failed loading /home/zaman/Documents/ZendStudio/plugins/com.zend.php.executables.linux_7.1.3.201703171134/resources/ext/./ext/ZendDebugger.so: /home/zaman/Documents/ZendStudio/plugins/com.zend.php.executables.linux_7.1.3.201703171134/resources/ext/./ext/ZendDebugger.so: cannot open shared object file: No such file or directory HOT 1
- PHP-function each() has been deprecated (ZF2)
- A plugin by the name "getServiceLocator" was not found in the plugin manager Zend\Mvc\Controller\PluginManager HOT 5
- This regex may stuck in matching HOT 2
- ZF3 and Apigility 1.5 HOT 1
- Error Handling for a Specific Module Only
- Phone number validation criteria HOT 2
- Session timeout even when user is active HOT 6
- I have changed my files according to issue 5997 but still getting error No translator provided HOT 1
- Function mcrypt_*() is deprecated in Zend/Crypt/Symmetric/Mcrypt.php (ZF2) PHP 7.2 HOT 1
- Why zendframework so tricky? HOT 1
- Use of a broken or else risky cryptographic algorithm md5() in Subscriber.php at line 788 HOT 1
- Question: Advanced Routing HOT 4
- PHP 7.3 compatibility issues for zend-stdlib : Warning: "continue" targeting switch is equivalent to "break". HOT 2
- Strange ZF3 class not found error HOT 3
- CONTRIBUTING.md is not available HOT 1
- Hello , i have an error and need help HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zendframework.