Skip to content

Commit e202896

Browse files
committed
fix: Override start method of \Sabre\DAV\Server to remove exception output
Signed-off-by: Louis Chemineau <louis@chmn.me>
1 parent 33928fc commit e202896

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

apps/dav/lib/Connector/Sabre/Server.php

+23
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,27 @@ public function __construct($treeOrNode = null) {
2525
self::$exposeVersion = false;
2626
$this->enablePropfindDepthInfinity = true;
2727
}
28+
29+
// Copied from 3rdparty/sabre/dav/lib/DAV/Server.php
30+
// Should be them exact same without the exception output.
31+
public function start(): void {
32+
try {
33+
// If nginx (pre-1.2) is used as a proxy server, and SabreDAV as an
34+
// origin, we must make sure we send back HTTP/1.0 if this was
35+
// requested.
36+
// This is mainly because nginx doesn't support Chunked Transfer
37+
// Encoding, and this forces the webserver SabreDAV is running on,
38+
// to buffer entire responses to calculate Content-Length.
39+
$this->httpResponse->setHTTPVersion($this->httpRequest->getHTTPVersion());
40+
41+
// Setting the base url
42+
$this->httpRequest->setBaseUrl($this->getBaseUri());
43+
$this->invokeMethod($this->httpRequest, $this->httpResponse);
44+
} catch (\Throwable $e) {
45+
try {
46+
$this->emit('exception', [$e]);
47+
} catch (\Exception $ignore) {
48+
}
49+
}
50+
}
2851
}

0 commit comments

Comments
 (0)