File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -69,4 +69,16 @@ abstract class RequestMethod
6969 * @var int
7070 */
7171 public const DELETE = 4 ;
72+
73+ /**
74+ * The HEAD request method.
75+ * @var int
76+ */
77+ public const HEAD = 5 ;
78+
79+ /**
80+ * The PATCH request method.
81+ * @var int
82+ */
83+ public const PATCH = 6 ;
7284}
Original file line number Diff line number Diff line change @@ -118,6 +118,14 @@ private function _detectMethod()
118118 $ this ->_request ->setMethod (RequestMethod::DELETE );
119119 break ;
120120
121+ case "head " :
122+ $ this ->_request ->setMethod (RequestMethod::HEAD );
123+ break ;
124+
125+ case "patch " :
126+ $ this ->_request ->setMethod (RequestMethod::PATCH );
127+ break ;
128+
121129 default :
122130 $ this ->_request ->setMethod (RequestMethod::UNKNOWN );
123131 break ;
@@ -167,7 +175,7 @@ private function _detectUri()
167175
168176 if (count ($ _POST ) > 0 ) {
169177 $ data = $ _POST ;
170- } elseif ($ this ->_request ->getMethod () === RequestMethod::PUT ) {
178+ } elseif ($ this ->_request ->getMethod () === RequestMethod::PUT || $ this -> _request -> getMethod () === RequestMethod:: PATCH ) {
171179 $ handle = fopen ("php://input " , "r " );
172180 $ rawData = '' ;
173181 while ($ chunk = fread ($ handle , 1024 )) {
You can’t perform that action at this time.
0 commit comments