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.
26 lines
312 B
26 lines
312 B
//go:build go1.5
|
|
// +build go1.5
|
|
|
|
package v4
|
|
|
|
import (
|
|
"net/url"
|
|
"strings"
|
|
)
|
|
|
|
func getURIPath(u *url.URL) string {
|
|
var uri string
|
|
|
|
if len(u.Opaque) > 0 {
|
|
uri = "/" + strings.Join(strings.Split(u.Opaque, "/")[3:], "/")
|
|
} else {
|
|
uri = u.EscapedPath()
|
|
}
|
|
|
|
if len(uri) == 0 {
|
|
uri = "/"
|
|
}
|
|
|
|
return uri
|
|
}
|