Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15400965
D12150.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D12150.diff
View Options
diff --git a/src/future/http/status/HTTPFutureHTTPResponseStatus.php b/src/future/http/status/HTTPFutureHTTPResponseStatus.php
--- a/src/future/http/status/HTTPFutureHTTPResponseStatus.php
+++ b/src/future/http/status/HTTPFutureHTTPResponseStatus.php
@@ -40,12 +40,17 @@
public function isError() {
if ($this->expect === null) {
- return ($this->getStatusCode() < 200) || ($this->getStatusCode() > 299);
+ return ($this->getStatusCode() < 200) || ($this->getStatusCode() > 299);
}
return !in_array($this->getStatusCode(), $this->expect, true);
}
+ public function isRedirect() {
+ $code = $this->getStatusCode();
+ return ($code >= 300 && $code < 400);
+ }
+
public function isTimeout() {
return false;
}
diff --git a/src/future/http/status/HTTPFutureResponseStatus.php b/src/future/http/status/HTTPFutureResponseStatus.php
--- a/src/future/http/status/HTTPFutureResponseStatus.php
+++ b/src/future/http/status/HTTPFutureResponseStatus.php
@@ -33,6 +33,10 @@
abstract public function isError();
abstract public function isTimeout();
+ public function isRedirect() {
+ return false;
+ }
+
abstract protected function getErrorCodeType($code);
abstract protected function getErrorCodeDescription($code);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 18, 3:00 PM (4 d, 4 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7599848
Default Alt Text
D12150.diff (1 KB)
Attached To
Mode
D12150: Add an isRedirect() method to HTTPResponseStatus
Attached
Detach File
Event Timeline
Log In to Comment