private function isValidRequest()
 {
     $result = false;
     if (null !== $this->request->getHeader('Authorization') && null !== $this->request->getHeader('User-Agent')) {
         $token = base64_decode($this->request->getHeader('Authorization'));
         $ua = $this->request->getHeader('User-Agent');
         if (stripos($ua, 'curl') === false) {
             if (substr($token, 0, 14) == 'phire-updater-') {
                 if (is_numeric(substr($token, 15))) {
                     $result = true;
                 }
             }
         }
     }
     return $result;
 }
Beispiel #2
0
 public function testGetAndSetHeaders()
 {
     $r = new Request();
     $this->assertNull($r->getHeader('Auth'));
     $this->assertEquals(0, count($r->getHeaders()));
 }