Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomocavalieri authored and lpil committed Nov 25, 2024
1 parent 7ac864a commit 55aa559
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/gleam/uri.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit 55aa559

Please sign in to comment.