Skip to content

Commit 55aa559

Browse files
giacomocavalierilpil
authored andcommitted
small fix
1 parent 7ac864a commit 55aa559

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/gleam/uri.gleam

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,6 @@ fn parse_host_within_brackets_loop(
226226
"" -> Ok(Uri(..pieces, host: Some(uri_string)))
227227

228228
// A `]` marks the end of the host and the start of the port part.
229-
// A port must always be preceded by a `:`, otherwise this is an invalid
230-
// uri.
231229
"]" <> rest if size == 0 -> parse_port(rest, pieces)
232230
"]" <> rest -> {
233231
let host = codeunit_slice(original, at_index: 0, length: size + 1)
@@ -268,8 +266,9 @@ fn parse_host_within_brackets_loop(
268266
case is_valid_host_withing_brackets_char(char) {
269267
True ->
270268
parse_host_within_brackets_loop(original, rest, pieces, size + 1)
269+
271270
False ->
272-
parse_host_outside_of_brackets_loop(original, rest, pieces, size + 1)
271+
parse_host_outside_of_brackets_loop(original, original, pieces, 0)
273272
}
274273
}
275274
}

0 commit comments

Comments
 (0)