1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 11:55:40 +01:00

Implemented index.txt check

This commit is contained in:
Sascha L. Teichmann 2021-12-16 00:43:50 +01:00
parent 30789e60d5
commit 57f8f06257
3 changed files with 87 additions and 28 deletions

View file

@ -36,11 +36,14 @@ func basePath(p string) (string, error) {
}
ep := u.EscapedPath()
if idx := strings.LastIndexByte(ep, '/'); idx != -1 {
ep = ep[:idx]
ep = ep[:idx+1]
}
user := u.User.String()
if user != "" {
user += "@"
}
return u.Scheme + "://" + user + u.Host + "/" + ep, nil
if !strings.HasPrefix(ep, "/") {
ep = "/" + ep
}
return u.Scheme + "://" + user + u.Host + ep, nil
}