fix url parsing with port numbers
String.get_slice_count is always at least 1 or 2 for bases with a port number.
Before this change the following URL would return ERR_INVALID_PARAMETER ```ws://127.0.0.1:8000/test```
(cherry picked from commit 3d9f29910c
)
This commit is contained in:
parent
28aacbfe85
commit
606331fdcb
1 changed files with 1 additions and 1 deletions
|
@ -180,7 +180,7 @@ Error String::parse_url(String &r_scheme, String &r_host, int &r_port, String &r
|
|||
base = base.substr(pos + 1, base.length() - pos - 1);
|
||||
} else {
|
||||
// Anything else
|
||||
if (base.get_slice_count(":") > 1) {
|
||||
if (base.get_slice_count(":") > 2) {
|
||||
return ERR_INVALID_PARAMETER;
|
||||
}
|
||||
pos = base.rfind(":");
|
||||
|
|
Loading…
Reference in a new issue