We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9f30095 commit 06dfc6cCopy full SHA for 06dfc6c
1 file changed
server.go
@@ -52,7 +52,17 @@ type ObjectError struct {
52
53
// ObjectLink builds a URL linking to the object.
54
func (v *RequestVars) ObjectLink() string {
55
- path := fmt.Sprintf("/%s/%s/objects/%s", v.User, v.Repo, v.Oid)
+ path := ""
56
+
57
+ if len(v.User) > 0 {
58
+ path += fmt.Sprintf("/%s", v.User)
59
+ }
60
61
+ if len(v.Repo) > 0 {
62
+ path += fmt.Sprintf("/%s", v.Repo)
63
64
65
+ path += fmt.Sprintf("/objects/%s", v.Oid)
66
67
if Config.IsHTTPS() {
68
return fmt.Sprintf("%s://%s%s", Config.Scheme, Config.Host, path)
0 commit comments