fix: follow undergraduate login links and capture live history URLs
This commit is contained in:
@@ -17,6 +17,23 @@ class UndergraduateNavigationPolicy {
|
||||
uri.path.startsWith('/eams/');
|
||||
static bool isLogout(Uri uri) =>
|
||||
isDataPage(uri) && uri.path == '/eams/logout.action';
|
||||
static Uri? secureIdentityRedirect(Uri uri) =>
|
||||
SchoolNavigationPolicy.secureIdentityRedirect(uri);
|
||||
static Uri? secureIdentityRedirect(Uri uri) {
|
||||
final identity = SchoolNavigationPolicy.secureIdentityRedirect(uri);
|
||||
if (identity != null) return identity;
|
||||
// Legacy duplicate-login links use HTTP even within the HTTPS portal.
|
||||
if (uri.scheme != 'http' ||
|
||||
uri.host != 'eams.uestc.edu.cn' ||
|
||||
uri.port != 80 ||
|
||||
uri.userInfo.isNotEmpty ||
|
||||
!(uri.path == '/eams' || uri.path.startsWith('/eams/'))) {
|
||||
return null;
|
||||
}
|
||||
return Uri(
|
||||
scheme: 'https',
|
||||
host: uri.host,
|
||||
path: uri.path,
|
||||
query: uri.hasQuery ? uri.query : null,
|
||||
fragment: uri.hasFragment ? uri.fragment : null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user