working commit
This commit is contained in:
@@ -58,3 +58,22 @@ func repackReference(ref string) (string, string, string, error) {
|
||||
ref = uri.Host + uri.Path
|
||||
return ref, username, password, err
|
||||
}
|
||||
|
||||
func repackSource(ref string) (string, string, string, error) {
|
||||
var err error
|
||||
var username string
|
||||
var password string
|
||||
if !strings.Contains(ref, `://`) {
|
||||
ref = "https://" + ref
|
||||
}
|
||||
uri, err := url.Parse(ref)
|
||||
if err != nil {
|
||||
return ref, username, password, err
|
||||
}
|
||||
username = uri.User.Username()
|
||||
password, _ = uri.User.Password()
|
||||
uri.User = nil
|
||||
|
||||
ref = uri.Host
|
||||
return ref, username, password, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user