示例#1
0
 function testMethodOverride()
 {
     $req = new Request();
     $req->mock(array("REQUEST_METHOD" => "POST", "HTTP_X_HTTP_METHOD_OVERRIDE" => "PUT"));
     $this->assertEquals("PUT", $req->getMethod());
     $this->assertEquals("POST", $req->getOriginalMethod());
 }
示例#2
0
 /**
  * Responds to the client to confirm method not allowed.
  *
  * @param \stdClass $match
  * @return void
  */
 protected function routeToNotAllowed($match)
 {
     $status = $this->request->getMethod() === "OPTIONS" ? 200 : 405;
     $this->response->setHeader("Allow", join(", ", $match->allowed));
     $this->response->setStatus($status);
 }