mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 08:38:18 +08:00
mod: isRedirect (#866)
This commit is contained in:
committed by
GitHub
parent
3993ff8a8e
commit
f29385ccef
@@ -23,15 +23,14 @@ class UrlUtils {
|
||||
validateStatus: (status) {
|
||||
return 200 <= status! && status < 400;
|
||||
},
|
||||
extra: {'account': AnonymousAccount()}),
|
||||
extra: {'account': AnonymousAccount()},
|
||||
),
|
||||
);
|
||||
if (response.isRedirect) {
|
||||
redirectUrl = response.headers['location']?.firstOrNull;
|
||||
debugPrint('redirectUrl: $redirectUrl');
|
||||
if (redirectUrl != null && !redirectUrl.startsWith('http')) {
|
||||
redirectUrl = Uri.parse(url).resolve(redirectUrl).toString();
|
||||
}
|
||||
}
|
||||
} catch (_) {}
|
||||
if (returnOri && redirectUrl == null) redirectUrl = url;
|
||||
if (redirectUrl?.endsWith('/') == true) {
|
||||
|
||||
Reference in New Issue
Block a user