-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Zend\Http\Response should treat 410 like a not found #7368
Comments
Sounds like a bad idea IMHO. I understand a As a compromise a new method |
I agree with @Martin-P because frankly they are two different things and if the api is so advanced it supports 410 then you should be looking for that specifically. This is also not that complicated if ($response->isNotFound() || $response->isGone()) |
It's not that "can be interpreted" is a 404, the RFC Specifically states that if the server knows the resource was there and is gone it should return 410. 404 Does NOT mean the resource was never there at all, just that simply it cannot find anything at the moment -- they are not two different things but simply the same thing with more detail. 404
I will be personally satisfied with an |
As per the discussion in zendframework/zendframework#7368 this change adds a new method \Zend\Http\Response->isGone() to determine if the status code is a "410 Gone". This works exactly the same as the similar methods like isNotFound simply by checking the status code. This change takes the opinion that a 410 Gone should not be included in the isNotFound() method. Further discussion can be seen in the issue.
As per the discussion in zendframework/zendframework#7368 this change adds a new method \Zend\Http\Response->isGone() to determine if the status code is a "410 Gone". This works exactly the same as the similar methods like isNotFound simply by checking the status code. This change takes the opinion that a 410 Gone should not be included in the isNotFound() method. Further discussion can be seen in the issue.
This issue has been moved from the |
According to RFC 2616 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html) A server has the option of returning a HTTP 410 status code when a resource is not found and moreover the server understands the resource will never return (gone).
From a ZF perspective, it seems to me that the Response::isNotFound() method should return true in this case, and at present it does not. A 410 is a 404, with more insight into the status of the resource.
The text was updated successfully, but these errors were encountered: