mirror of
https://github.com/shlldev/miniws.git
synced 2025-09-02 19:00:59 +02:00
22 lines
342 B
Go
22 lines
342 B
Go
package main
|
|
|
|
import (
|
|
"strconv"
|
|
"strings"
|
|
)
|
|
|
|
func getHttpVersionString(major, minor int) string {
|
|
return "HTTP/" + strconv.Itoa(major) + "." + strconv.Itoa(minor)
|
|
}
|
|
|
|
func getOrDash(str string) string {
|
|
if str == "" {
|
|
return "-"
|
|
}
|
|
return str
|
|
}
|
|
|
|
func ensureSlashSuffix(str string) string {
|
|
return strings.TrimSuffix(str, "/") + "/"
|
|
}
|