Skip to content

An open-source cross-platform alternative to AirDrop

fix: handshake error in unencrypted mode

Tien Do Nama69f30bd48fc
diff --git a/assets/CHANGELOG.md b/assets/CHANGELOG.md
index c20583e8..b2304f2f 100644
--- a/assets/CHANGELOG.md
+++ b/assets/CHANGELOG.md
@@ -8,6 +8,7 @@
- feat(android): Android TV support
- feat(windows): left click on tray icon opens app
- feat(linux): add Control+Q shortcut to exit app
+- fix: handshake error in unencrypted mode
- fix: also scan multicast when pressing on a subnet sync button
- fix(android): missing app icon on Android 7
- fix(android,ios): show error message when saving to gallery failed
diff --git a/lib/util/api_route_builder.dart b/lib/util/api_route_builder.dart
index 024852b0..da2dfe7e 100644
--- a/lib/util/api_route_builder.dart
+++ b/lib/util/api_route_builder.dart
@@ -17,10 +17,11 @@ enum ApiRoute {
/// The client url
String target(Device target, {Map<String, String>? query}) {
+ final protocol = target.https ? 'https' : 'http';
if (query != null) {
- return 'https://${target.ip}:${target.port}$path?${query.entries.map((e) => '${e.key}=${e.value}').join('&')}';
+ return '$protocol://${target.ip}:${target.port}$path?${query.entries.map((e) => '${e.key}=${e.value}').join('&')}';
} else {
- return 'https://${target.ip}:${target.port}$path';
+ return '$protocol://${target.ip}:${target.port}$path';
}
}