Skip to content

Commit d080141

Browse files
zhenorzzaa2013
authored andcommitted
Fix cannot be used to imply a default content-type
(cherry picked from commit 9631832)
1 parent 06f0e55 commit d080141

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

lib/src/webdav_dio.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,10 @@ class WdDio with DioMixin implements Dio {
469469
'PUT',
470470
path,
471471
data: Stream.fromIterable(data.map((e) => [e])),
472-
optionsHandler: (options) =>
473-
options.headers?['content-length'] = data.length,
472+
optionsHandler: (options) {
473+
options.headers?['content-length'] = data.length;
474+
options.headers?['content-type'] = "application/octet-stream";
475+
},
474476
onSendProgress: onProgress,
475477
cancelToken: cancelToken,
476478
);
@@ -504,7 +506,10 @@ class WdDio with DioMixin implements Dio {
504506
'PUT',
505507
path,
506508
data: data,
507-
optionsHandler: (options) => options.headers?['content-length'] = length,
509+
optionsHandler: (options) {
510+
options.headers?['content-length'] = length;
511+
options.headers?['content-type'] = "application/octet-stream";
512+
},
508513
onSendProgress: onProgress,
509514
cancelToken: cancelToken,
510515
);

0 commit comments

Comments
 (0)