mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-19 03:26:57 +00:00
move helper func in related packages
This commit is contained in:
parent
5b81a8b8bc
commit
690879440a
6 changed files with 66 additions and 54 deletions
11
server/utils/utils.go
Normal file
11
server/utils/utils.go
Normal file
|
@ -0,0 +1,11 @@
|
|||
package utils
|
||||
|
||||
import "bytes"
|
||||
|
||||
func TrimHostPort(host []byte) []byte {
|
||||
i := bytes.IndexByte(host, ':')
|
||||
if i >= 0 {
|
||||
return host[:i]
|
||||
}
|
||||
return host
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue