You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
kratos/internal/endpoint/endpoint.go

22 lines
385 B

package endpoint
import (
"net/url"
"strconv"
)
func NewEndpoint(scheme, host string, isSecure bool) *url.URL {
var query string
if isSecure {
query = "isSecure=true"
}
return &url.URL{Scheme: scheme, Host: host, RawQuery: query}
}
func IsSecure(url *url.URL) bool {
ok, err := strconv.ParseBool(url.Query().Get("isSecure"))
if err != nil {
return false
}
return ok
}