mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2024-11-18 18:39:42 +00:00
11 lines
153 B
Go
11 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
|
|
}
|