Merge pull request #391 from owncloud/no-multiple-verbs

Fix logged notices
pull/1/head
VicDeo 10 years ago
commit 815ab65e00

@ -26,10 +26,10 @@ $application->registerRoutes($this, array(
array('name' => 'session#poll', 'url' => 'ajax/otpoll.php', 'verb' => 'POST'),
//documents
array('name' => 'document#create', 'url' => 'ajax/documents/create', 'verb' => 'POST'),
array('name' => 'document#serve', 'url' => 'ajax/genesis/{esId}', 'verb' => 'GET', 'HEAD'),
array('name' => 'document#serve', 'url' => 'ajax/genesis/{esId}', 'verb' => 'GET'),
array('name' => 'document#rename', 'url' => 'ajax/documents/rename/{fileId}', 'verb' => 'POST'),
array('name' => 'document#listAll', 'url' => 'ajax/documents/list', 'verb' => 'GET'),
array('name' => 'document#download', 'url' => 'ajax/download.php', 'verb' => array('GET', 'HEAD')),
array('name' => 'document#download', 'url' => 'ajax/download.php', 'verb' => 'GET'),
//settings
array('name' => 'settings#savePersonal', 'url' => 'ajax/personal.php', 'verb' => 'POST'),
array('name' => 'settings#setUnstable', 'url' => 'ajax/config/unstable', 'verb' => 'POST'),

File diff suppressed because one or more lines are too long

@ -28,17 +28,17 @@ class DownloadResponse extends \OCP\AppFramework\Http\Response {
$this->request = $request;
$this->user = $user;
$this->path = $path;
$this->view = new View('/' . $user);
if (!$this->view->file_exists($path)){
$this->setStatus(Http::STATUS_NOT_FOUND);
parent::setStatus(Http::STATUS_NOT_FOUND);
}
}
public function render(){
if ($this->status === Http::STATUS_NOT_FOUND){
if (parent::getStatus() === Http::STATUS_NOT_FOUND){
return '';
}
$info = $this->view->getFileInfo($this->path);
$this->ETag = $info['etag'];
@ -47,7 +47,7 @@ class DownloadResponse extends \OCP\AppFramework\Http\Response {
$size = strlen($data['content']);
if (!is_null($this->request->server['HTTP_RANGE'])){
if (isset($this->request->server['HTTP_RANGE']) && !is_null($this->request->server['HTTP_RANGE'])){
$isValidRange = preg_match('/^bytes=\d*-\d*(,\d*-\d*)*$/', $this->request->server['HTTP_RANGE']);
if (!$isValidRange){
return $this->sendRangeNotSatisfiable($size);

Loading…
Cancel
Save