Skip to content

Commit

Permalink
🐛 fix: origin should not modify scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
wssgcg1213 authored and andycall committed Aug 26, 2021
1 parent a7b89ef commit 003ffd8
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions kraken/lib/src/foundation/http_overrides.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,11 @@ KrakenHttpOverrides setupHttpOverrides(HttpClientInterceptor? httpClientIntercep

// Returns the origin of the URI in the form scheme://host:port
String getOrigin(Uri uri) {
if (uri.scheme.isEmpty) {
// Set https as default scheme.
uri = uri.replace(scheme: 'https');
}

if (uri.isScheme('http')
|| uri.isScheme('https')) {
return uri.origin;
} else {
return '${uri.scheme}://${uri.host}:${uri.port}';
return uri.path;
}
}

Expand Down

0 comments on commit 003ffd8

Please sign in to comment.