File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -192,4 +192,21 @@ class IndependentCookieJar implements CookieJar {
192
192
193
193
@override
194
194
final bool ignoreExpires;
195
+
196
+ void deleteCookiesByName (String name) {
197
+ for (final domain in hostCookies.keys) {
198
+ final cookies = hostCookies[domain]! ;
199
+ for (final path in cookies.keys) {
200
+ final values = cookies[path]! ;
201
+ values.remove (name);
202
+ }
203
+ }
204
+ for (final domain in domainCookies.keys) {
205
+ final cookies = domainCookies[domain]! ;
206
+ for (final path in cookies.keys) {
207
+ final values = cookies[path]! ;
208
+ values.remove (name);
209
+ }
210
+ }
211
+ }
195
212
}
Original file line number Diff line number Diff line change @@ -120,6 +120,9 @@ class UISLoginTool {
120
120
workDio.interceptors.add (CookieManager (workJar));
121
121
workDio.interceptors.add (DioLogInterceptor ());
122
122
123
+ // fixme: workaround by deleting `CASTGC` cookie before requesting the UIS page
124
+ // See https://github.com/DanXi-Dev/DanXi/issues/491 for details.
125
+ workJar.deleteCookiesByName ("CASTGC" );
123
126
Map <String ?, String ?> data = {};
124
127
Response <String > res = await workDio.get (serviceUrl);
125
128
BeautifulSoup (res.data! ).findAll ("input" ).forEach ((element) {
You can’t perform that action at this time.
0 commit comments