mod: reply jump

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-10 12:01:19 +08:00
parent 6817eb6e56
commit 0f63976a00
3 changed files with 44 additions and 4 deletions

View File

@@ -24,6 +24,9 @@ class UrlUtils {
if (response.statusCode == 302 || response.statusCode == 301) {
String? redirectUrl = response.headers['location']?.first;
if (redirectUrl != null) {
if (redirectUrl.startsWith('/')) {
return url;
}
if (redirectUrl.endsWith('/')) {
redirectUrl = redirectUrl.substring(0, redirectUrl.length - 1);
}