Commit Graph

38 Commits

Author SHA1 Message Date
Daniel Kesselberg e984357cfc
Set retry = false for forbidden exception.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2020-06-25 23:34:41 +02:00
Christoph Wurst caff1023ea
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds
unified formatting for control structures like if and loops as well as
classes, their methods and anonymous functions. This basically forces
the constructs to start on the same line. This is not exactly what PSR2
wants, but I think we can have a few exceptions with "our" style. The
starting of braces on the same line is pracrically standard for our
code.

This also removes and empty lines from method/function bodies at the
beginning and end.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 14:19:56 +02:00
Christoph Wurst 14c996d982
Use elseif instead of else if
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-04-10 10:35:09 +02:00
Christoph Wurst 1a9330cd69
Update the license headers for Nextcloud 19
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-31 14:52:54 +02:00
Christoph Wurst b80ebc9674
Use the short array syntax, everywhere
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2020-03-26 16:34:56 +01:00
Christoph Wurst 5bf3d1bb38
Update license headers
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2019-12-05 15:38:45 +01:00
Arthur Schiwon 0e911d643f
delay creation of the cert bundle
fixes #18148

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2019-11-28 17:00:55 +01:00
Roeland Jago Douma 68748d4f85
Some php-cs fixes
* Order the imports
* No leading slash on imports
* Empty line before namespace
* One line per import
* Empty after imports
* Emmpty line at bottom of file

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-22 20:52:10 +01:00
Roeland Jago Douma c08e803db3
Catch forbidden http status code
If you try to do something on a DAV mount (external or federated share)
that is not allowed. We should not mark the storage as not available but
just fail somewhat gracefully.

Now by catching this and just properly returning the operation will just
fail (and notify the user) which is already a lot better then marking
the storage as unavailable and doing boom.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2019-11-17 09:11:15 +01:00
Joas Schilling 323642454a
Undefined variable response when server is no nextcloud anymore
Signed-off-by: Joas Schilling <coding@schilljs.com>
2019-08-20 12:54:58 +02:00
Robin Appelman 631ae17dce
handle long etags from dav external storage
we can only store etags up to 40 characters long in the database, so when we get an etag that's longer we simply hash it to bring down the length

Signed-off-by: Robin Appelman <robin@icewind.nl>
2019-03-14 14:46:39 +01:00
Roeland Jago Douma 01bbd28530
Do not log to error loglevel when converting the error
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-08-06 16:31:30 +02:00
Roeland Jago Douma 54c4d95a11
Request a valid property for DAV opendir
Apperently Sabre and Onedrive are not friends when requesting a single
404 property. I need to dig deeper on why this is. Anyways requesting a
valid property makes it work like a charm.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-06-21 19:01:27 +02:00
Arthur Schiwon 38a90130ce
move log constants to ILogger
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2018-04-26 10:45:52 +02:00
Morris Jobke 67dcff7a1f
Fix undefined variable - found by Phan
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-04-23 11:30:22 +02:00
Robin Appelman 97b44605f4
Adjust dav client to new guzzle
Signed-off-by: Robin Appelman <robin@icewind.nl>
2018-02-09 17:13:24 +01:00
Morris Jobke 9ff51aafc5
Use index based string access for substr with length of 1
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-26 13:38:34 +01:00
Morris Jobke 2a38605545
Properly log the full exception instead of only the message
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-01-23 10:57:21 +01:00
Roeland Jago Douma e47137c7d4
Merge pull request #6682 from nextcloud/dav-mimetype-fallback
Fallback to filename based detection if the remote dav server doesn't…
2017-12-11 15:28:05 +01:00
Morris Jobke 4866314ce0
Run updated license header updater
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-07 13:47:42 +01:00
Morris Jobke 0eebff152a
Update license headers
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 16:56:19 +01:00
Robin Appelman b36dd8b71f
Fallback to filename based detection if the remote dav server doesn't know the mimetype
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-09-28 14:22:42 +02:00
Morris Jobke c54a59d51e
Remove unused use statements
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-04-22 19:23:31 -05:00
Jörn Friedrich Dreyer 9eca1da1dd
allow configuring authType for DAV backend
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-03-22 18:13:42 -06:00
Robin Appelman 25dc140511
Make it easier to subclass DAV storage
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-02-15 14:00:00 +01:00
vkuimov 71a022640b bug when connect to yandex webdav server
server think that request like 
<?xml version="1.0" encoding="UTF-8"?> 
<d:propfind xmlns:d="DAV:">
<d:prop/> 
</d:propfind>

is 400: Bad Request
2017-02-10 16:31:49 +00:00
Robin Appelman 38ec2a35f2
Make DAV external storage test more reliable
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-01-24 16:56:24 +01:00
Roeland Jago Douma 447e388ce9 Merge pull request #2744 from nextcloud/oc_26324
[downstream] Fix DAV stat cache to properly cache 404
2017-01-11 08:16:40 +01:00
Robin Appelman 5774d3e82c
replace close:// streamwrapper with CallBackWrapper
Signed-off-by: Robin Appelman <robin@icewind.nl>
2017-01-06 15:33:32 +01:00
Vincent Petry 6d4abdab8f
Fix DAV stat cache to properly cache 404
404 errors were not properly cached due to catching the wrong
exception. Now catching ClientHttpException and checking the error
code. In case of 404, adjust the stat cache accordingly.
2017-01-05 09:39:07 +01:00
Joas Schilling 0215b004da
Update with robin 2016-07-21 18:13:58 +02:00
Joas Schilling ba87db3fcc
Fix others 2016-07-21 18:13:57 +02:00
Robin Appelman 2a72eff9ee Fix getting the certificate bundle for dav external storage (#25274)
* Fix getting the certificate bundle for dav external storages

* Log the original exception in dav external storage
2016-06-27 22:26:43 +02:00
Robin Appelman 88ef163276 handle unavailable fed shares while testing for availability (#25277)
* More explicit http status codes

* handle unavailable fed shares while testing for availability
2016-06-27 21:34:28 +02:00
Vincent Petry 5d7f37d570
Check whether remote DAV server accepted the mtime on touch
ownCloud as remote DAV always accepts the mtime on touch, but other
servers like Apache's DAV server doesn't. The latter doesn't give any
visible hint in its response to detect this case, so this fix does a
subsequent PROPFIND to check whether the mtime was actually set.

Since a touch() operation seldom happens (only on uploads), the minor
performance loss should hopefully be acceptable.
2016-05-30 16:10:30 +02:00
Vincent Petry 6f346b4b1f
Fix webdav destination header when overwriting folders
The trailing slash is needed when talking to Apache's mod_dav server
2016-05-30 16:10:30 +02:00
Lukas Reschke aba539703c
Update license headers 2016-05-26 19:57:24 +02:00
Roeland Jago Douma dedf392751
Move \OC\Files to PSR-4 2016-04-24 21:37:35 +02:00