fix(app): a one-word address is refused at once; this machine's is reached over HTTP

An address of one word (`todo`) was read as https://todo/ and looked for,
the person waiting up to 15 s for no instance to answer. A host is now a
domain of two labels or more, an IP address or localhost; anything else is
"This isn't an address." as it is typed. localhost and loopback addresses
typed without a scheme are reached over HTTP, as a server running on the
same machine has no certificate; HTTPS where typed (the developer's
review, 9 Nov 2026).

Whats-New: An address of a single word is now refused at once, rather than looked for.
Whats-New-De: Eine Adresse aus nur einem Wort wird jetzt sofort abgelehnt, statt danach zu suchen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-11-09 23:15:27 +01:00
commit f7341922e5
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -220,6 +220,21 @@ void main() {
expect(opened, isEmpty);
});
testWidgets('a single word is no address, said at once rather than looked '
"for (the developer's review, 9 Nov 2026)", (tester) async {
await start(tester, answering: {other});
await tester.tap(find.text('Another instance'));
await tester.pumpAndSettle();
await tester.enterText(find.byType(TextField), 'todo');
await tester.tap(find.text('Continue'));
await tester.pump();
expect(find.text("This isn't an address."), findsOneWidget);
expect(find.byType(LinearProgressIndicator), findsNothing);
expect(opened, isEmpty);
});
testWidgets('an instance kept from before over plain HTTP is never opened: '
'another is used, or it is removed', (tester) async {
final insecure = Instance.parse('http://learn.example.net')!;