Skip to content

Commit

Permalink
Merge pull request #110 from parlough/fix/loading-redirects-as-not-ex…
Browse files Browse the repository at this point in the history
…ternal

Fix destination's final URI being saved too early
  • Loading branch information
filiph authored Dec 30, 2022
2 parents 90fac28 + e9754c6 commit e17f368
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/src/destination.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ class Destination {
// them via toMap?
bool wasDeniedByRobotsTxt = false;

Uri? _finalUri;

/// The encoding is not UTF-8 or LATIN-1.
bool hasUnsupportedEncoding = false;

Expand All @@ -110,7 +108,7 @@ class Destination {
// TODO: make sure we don't assign the same hashcode to two destinations like
// '../' from different subdirectory levels.
/// Parsed [finalUrl].
Uri get finalUri => _finalUri ??= Uri.parse(finalUrl ?? url);
Uri get finalUri => Uri.parse(finalUrl ?? url);

@override
int get hashCode => url.hashCode;
Expand Down Expand Up @@ -142,7 +140,7 @@ class Destination {
bool get isRedirected => redirects.isNotEmpty;

/// True if the destination URI isn't one of the [supportedSchemes].
late final bool isUnsupportedScheme = () {
bool get isUnsupportedScheme {
var specifiedUnsupported = _isUnsupportedScheme;
if (specifiedUnsupported != null) return specifiedUnsupported;
bool result = true;
Expand All @@ -153,7 +151,7 @@ class Destination {
// Pass.
}
return result;
}();
}

String get statusDescription {
if (isUnsupportedScheme) return "scheme unsupported";
Expand Down

0 comments on commit e17f368

Please sign in to comment.