Commit 13a3581 1 parent 2addc67 commit 13a3581 Copy full SHA for 13a3581
File tree 1 file changed +13
-5
lines changed
packages/nextcloud/lib/src/api/webdav
1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -21,18 +21,26 @@ final checksumPattern = RegExp(
21
21
caseSensitive: false ,
22
22
);
23
23
24
- /// WebDavClient class
24
+ /// WebDavClient class.
25
25
class WebDavClient extends DynamiteClient {
26
26
/// Creates a new `WebDavClient` .
27
+ ///
28
+ /// The [httpClient] parameter specifies whether requests should attach a
29
+ /// CSRF-Token to sent requests.
30
+ /// Until Nextcloud 30 this is required to work around an authorization bug
31
+ /// triggered, when cookies are also sent.
27
32
WebDavClient (
28
33
super .baseURL, {
29
34
http.Client ? httpClient,
30
35
super .authentications,
36
+ bool useCSRFClient = true ,
31
37
}) : super (
32
- httpClient: WebDavCSRFClient (
33
- baseURL,
34
- httpClient: httpClient,
35
- ),
38
+ httpClient: useCSRFClient
39
+ ? WebDavCSRFClient (
40
+ baseURL,
41
+ httpClient: httpClient,
42
+ )
43
+ : httpClient,
36
44
);
37
45
38
46
/// Creates a new [WebDavClient] from another [client] .
You can’t perform that action at this time.
0 commit comments