diff options
author | Giacomo Cavalieri <giacomo.cavalieri@icloud.com> | 2024-11-18 11:40:38 +0100 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2024-11-25 17:49:59 +0000 |
commit | 55aa55909fab54927bc52dfccbde4bd979eecea3 (patch) | |
tree | 8741f1ceca834a05f57e5c29b2300b02e12e82f5 | |
parent | 7ac864ab932b795b9cb8e68b2c0dac58c8f41703 (diff) | |
download | gleam_stdlib-55aa55909fab54927bc52dfccbde4bd979eecea3.tar.gz gleam_stdlib-55aa55909fab54927bc52dfccbde4bd979eecea3.zip |
small fix
-rw-r--r-- | src/gleam/uri.gleam | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gleam/uri.gleam b/src/gleam/uri.gleam index a6af0ab..1de5f1e 100644 --- a/src/gleam/uri.gleam +++ b/src/gleam/uri.gleam @@ -226,8 +226,6 @@ fn parse_host_within_brackets_loop( "" -> Ok(Uri(..pieces, host: Some(uri_string))) // A `]` marks the end of the host and the start of the port part. - // A port must always be preceded by a `:`, otherwise this is an invalid - // uri. "]" <> rest if size == 0 -> parse_port(rest, pieces) "]" <> rest -> { let host = codeunit_slice(original, at_index: 0, length: size + 1) @@ -268,8 +266,9 @@ fn parse_host_within_brackets_loop( case is_valid_host_withing_brackets_char(char) { True -> parse_host_within_brackets_loop(original, rest, pieces, size + 1) + False -> - parse_host_outside_of_brackets_loop(original, rest, pieces, size + 1) + parse_host_outside_of_brackets_loop(original, original, pieces, 0) } } } |