diff --git a/safe_url_check/lib/safe_url_check.dart b/safe_url_check/lib/safe_url_check.dart index 7c6acd60..c7c6ba27 100644 --- a/safe_url_check/lib/safe_url_check.dart +++ b/safe_url_check/lib/safe_url_check.dart @@ -160,7 +160,7 @@ Future _safeUrlCheck( response.headers[HttpHeaders.locationHeader]!.isNotEmpty && maxRedirects > 0) { final loc = Uri.parse(response.headers[HttpHeaders.locationHeader]![0]); - final nextUri = loc.hasScheme ? loc : url.resolveUri(loc); + final nextUri = url.resolveUri(loc); return _safeUrlCheck( nextUri, maxRedirects - 1, diff --git a/safe_url_check/test/safe_url_check_test.dart b/safe_url_check/test/safe_url_check_test.dart index b2d7f0ab..b06a3f88 100644 --- a/safe_url_check/test/safe_url_check_test.dart +++ b/safe_url_check/test/safe_url_check_test.dart @@ -27,5 +27,6 @@ void main() { testValidUrl('https://google.com'); testValidUrl('https://github.com'); testValidUrl('https://github.com/google/dart-neats.git'); + testValidUrl('https://httpbin.org/redirect-to?url=status%2F200'); testInvalidUrl('https://github.com/google/dart-neats.git/bad-url'); }