mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2024-11-26 05:55:27 +00:00
12 lines
153 B
Go
12 lines
153 B
Go
|
package utils
|
||
|
|
||
|
import "bytes"
|
||
|
|
||
|
func TrimHostPort(host []byte) []byte {
|
||
|
i := bytes.IndexByte(host, ':')
|
||
|
if i >= 0 {
|
||
|
return host[:i]
|
||
|
}
|
||
|
return host
|
||
|
}
|