mirror of
https://github.com/localsend/localsend.git
synced 2026-04-29 03:00:23 -04:00
Dart's Uri.tryParse is very permissive and will successfully parse strings like "https://example.com some extra text" as valid absolute URIs. This caused the receiver to incorrectly classify any message beginning with a URL as a link, even when it contained additional non-URL text. Add a whitespace check before URI parsing so that only messages consisting entirely of a single URL (with optional surrounding whitespace) are treated as links. Fixes #2904 Co-authored-by: easonysliu <easonysliu@tencent.com>