mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
664d65d7fb
This fixes an issue where the object path is not normalized.
18 lines
373 B
Go
18 lines
373 B
Go
package utils
|
|
|
|
import (
|
|
"net/url"
|
|
"path"
|
|
)
|
|
|
|
// URLPathFullClean returns a URL path with the query parameters appended (full path) with the path portion parsed
|
|
// through path.Clean given a *url.URL.
|
|
func URLPathFullClean(u *url.URL) (p string) {
|
|
switch len(u.RawQuery) {
|
|
case 0:
|
|
return path.Clean(u.Path)
|
|
default:
|
|
return path.Clean(u.Path) + "?" + u.RawQuery
|
|
}
|
|
}
|