Skip to content

Commit

Permalink
No 404 status in case there is any other status
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepDiver1975 committed May 3, 2016
1 parent a01f4ab commit 17f54b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/DAV/Xml/Element/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ function xmlSerialize(Writer $writer) {
$empty = true;

foreach ($this->getResponseProperties() as $status => $properties) {
if ( $properties && (ctype_digit($status) || is_int($status))) {
if ($properties && (ctype_digit($status) || is_int($status))) {
$empty = false;
$writer->startElement('{DAV:}propstat');
$writer->writeElement('{DAV:}prop', $properties);
$writer->writeElement('{DAV:}status', 'HTTP/1.1 ' . $status . ' ' . \Sabre\HTTP\Response::$statusCodes[$status]);
$writer->endElement(); // {DAV:}propstat
}
if ( !$properties && (ctype_digit($status) || is_int($status))) {
if ($empty && !$properties && (ctype_digit($status) || is_int($status))) {
$empty = false;
$writer->writeElement('{DAV:}status', 'HTTP/1.1 ' . $status . ' ' . \Sabre\HTTP\Response::$statusCodes[$status]);
}
Expand Down
1 change: 1 addition & 0 deletions tests/Sabre/DAV/Sync/PluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ function testSyncInitialSyncCollection() {

$this->assertEquals(207, $response->status, 'Full response body:' . $response->body);

/** @var DAV\Xml\Response\MultiStatus $multiStatus */
$multiStatus = $this->server->xml->parse($response->getBodyAsString());

// Checking the sync-token
Expand Down

0 comments on commit 17f54b3

Please sign in to comment.