]> git.proxmox.com Git - flutter/proxmox_login_manager.git/commit
fix issue when 443 port is used
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 23 Sep 2020 08:20:16 +0000 (10:20 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 23 Sep 2020 08:20:19 +0000 (10:20 +0200)
commit59ab8956a92a4482f9c9a214b3b508f85f59d951
tree287dbe71885364071702a8e65c80a45ea1098068
parenteeba8b5063fac2f282b63cc741e198b6b10fd35a
fix issue when 443 port is used

The reason for this issue was that the dart Uri.hasPort[0] property
is queried when checking if the passed URL has no port added and thus
the implied 8006 port should be added. For https and port 443 the
port is detected as "default" and omitted, thus this is always false
for that, argh!

Just use a simple regex on the original trimmed origin text.
IPv6 must be wrapped in brackets so [::1] or [::1]:443 is also
correctly detected.

[0]: https://api.dart.dev/stable/2.9.1/dart-core/Uri/hasPort.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
lib/proxmox_login_form.dart