forked from TrueCloudLab/frostfs-s3-gw
818176e7e1
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
25 lines
312 B
Go
25 lines
312 B
Go
//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
|
|
}
|