File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
lib/private/connector/sabre
tests/lib/connector/sabre Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ public function __construct(IConfig $config) {
46
46
}
47
47
48
48
/**
49
- * @param \Sabre\DAV\ $server
49
+ * @param \Sabre\DAV\Server $server
50
50
* @return void
51
51
*/
52
52
public function initialize (\Sabre \DAV \Server $ server ) {
@@ -62,6 +62,10 @@ public function initialize(\Sabre\DAV\Server $server) {
62
62
*/
63
63
public function beforeHandler (RequestInterface $ request ) {
64
64
$ userAgent = $ request ->getHeader ('User-Agent ' );
65
+ if ($ userAgent === null ) {
66
+ return ;
67
+ }
68
+
65
69
$ minimumSupportedDesktopVersion = $ this ->config ->getSystemValue ('minimum.supported.desktop.version ' , '1.7.0 ' );
66
70
67
71
// Match on the mirall version which is in scheme "Mozilla/5.0 (%1) mirall/%2" or
Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ public function newAndAlternateDesktopClientProvider() {
97
97
* @dataProvider newAndAlternateDesktopClientProvider
98
98
* @param string $userAgent
99
99
*/
100
- public function testBeforeHandlerSucess ($ userAgent ) {
100
+ public function testBeforeHandlerSuccess ($ userAgent ) {
101
101
/** @var \Sabre\HTTP\RequestInterface $request */
102
102
$ request = $ this ->getMock ('\Sabre\HTTP\RequestInterface ' );
103
103
$ request
@@ -115,4 +115,15 @@ public function testBeforeHandlerSucess($userAgent) {
115
115
$ this ->blockLegacyClientVersionPlugin ->beforeHandler ($ request );
116
116
}
117
117
118
+ public function testBeforeHandlerNoUserAgent () {
119
+ /** @var \Sabre\HTTP\RequestInterface $request */
120
+ $ request = $ this ->getMock ('\Sabre\HTTP\RequestInterface ' );
121
+ $ request
122
+ ->expects ($ this ->once ())
123
+ ->method ('getHeader ' )
124
+ ->with ('User-Agent ' )
125
+ ->will ($ this ->returnValue (null ));
126
+ $ this ->blockLegacyClientVersionPlugin ->beforeHandler ($ request );
127
+ }
128
+
118
129
}
You can’t perform that action at this time.
0 commit comments