File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ### [ 1.2.2]
4+ - 302 redirect: redirect to the real link. Thanks [ @cmlanche ] ( https://github.com/flymzero/webdav_client/pull/46 )
5+
36### [ 1.2.1]
47- Dio Dependency Update
58
Original file line number Diff line number Diff line change @@ -132,6 +132,25 @@ class WdDio with DioMixin implements Dio {
132132 onReceiveProgress: onReceiveProgress,
133133 cancelToken: cancelToken,
134134 );
135+ } else if (resp.statusCode == 302 ) {
136+ // 文件位置被重定向到新路径
137+ if (resp.headers.map.containsKey ('location' )) {
138+ List <String >? list = resp.headers.map['location' ];
139+ if (list != null && list.isNotEmpty) {
140+ String redirectPath = list[0 ];
141+ // retry
142+ return this .req <T >(
143+ self,
144+ method,
145+ redirectPath,
146+ data: data,
147+ optionsHandler: optionsHandler,
148+ onSendProgress: onSendProgress,
149+ onReceiveProgress: onReceiveProgress,
150+ cancelToken: cancelToken,
151+ );
152+ }
153+ }
135154 }
136155
137156 return resp;
Original file line number Diff line number Diff line change 11name : webdav_client
22description : A simple WebDAV client that supports some common methods.
33
4- version : 1.2.1
4+ version : 1.2.2
55homepage : https://github.com/flymzero/webdav_client
66
77environment :
You can’t perform that action at this time.
0 commit comments