mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-11-29 11:24:11 +01:00
Only return collection on GET.
Opens up for using HEAD to get status.
This commit is contained in:
parent
ae095acb2b
commit
dfefa2be55
@ -60,15 +60,17 @@ class AddressBookController extends BaseController {
|
||||
$response->setETag(md5($lastModified));
|
||||
}
|
||||
|
||||
$contacts = array();
|
||||
foreach($addressBook->getChildren() as $i => $contact) {
|
||||
$result = JSONSerializer::serializeContact($contact);
|
||||
//\OCP\Util::writeLog('contacts', __METHOD__.' contact: '.print_r($result, true), \OCP\Util::DEBUG);
|
||||
if($result !== null) {
|
||||
$contacts[] = $result;
|
||||
if($this->request->method === 'GET') {
|
||||
$contacts = array();
|
||||
foreach($addressBook->getChildren() as $i => $contact) {
|
||||
$result = JSONSerializer::serializeContact($contact);
|
||||
//\OCP\Util::writeLog('contacts', __METHOD__.' contact: '.print_r($result, true), \OCP\Util::DEBUG);
|
||||
if($result !== null) {
|
||||
$contacts[] = $result;
|
||||
}
|
||||
}
|
||||
$response->setParams(array('contacts' => $contacts));
|
||||
}
|
||||
$response->setParams(array('contacts' => $contacts));
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user