You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
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```
This commit is contained in:
@@ -275,7 +275,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);
|
base = base.substr(pos + 1, base.length() - pos - 1);
|
||||||
} else {
|
} else {
|
||||||
// Anything else
|
// Anything else
|
||||||
if (base.get_slice_count(":") > 1) {
|
if (base.get_slice_count(":") > 2) {
|
||||||
return ERR_INVALID_PARAMETER;
|
return ERR_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
pos = base.rfind(":");
|
pos = base.rfind(":");
|
||||||
|
|||||||
Reference in New Issue
Block a user