1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vweb: add host option to controller (#18303)

This commit is contained in:
Casper Kuethe
2023-05-30 14:22:23 +02:00
committed by GitHub
parent 05b832a317
commit 4174048f96
6 changed files with 92 additions and 7 deletions

View File

@@ -1003,7 +1003,7 @@ pub fn (u &URL) port() string {
// split_host_port separates host and port. If the port is not valid, it returns
// the entire input as host, and it doesn't check the validity of the host.
// Per RFC 3986, it requires ports to be numeric.
fn split_host_port(hostport string) (string, string) {
pub fn split_host_port(hostport string) (string, string) {
mut host := hostport
mut port := ''
colon := host.last_index_u8(`:`)