mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2024-11-23 06:18:59 +00:00
b9966487f6
close #100 close #109 close #113 close #28 close #63 Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/106
14 lines
162 B
Go
14 lines
162 B
Go
package utils
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
func TrimHostPort(host string) string {
|
|
i := strings.IndexByte(host, ':')
|
|
if i >= 0 {
|
|
return host[:i]
|
|
}
|
|
return host
|
|
}
|