aboutsummaryrefslogtreecommitdiff
path: root/pkg/instance/instance.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2021-10-11 22:48:14 +0200
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2021-10-11 22:48:14 +0200
commit3d14dcc45ce0f09b8c8d2843492064f5395263e0 (patch)
tree3843a1ecd6c8a5c832e769b7334c43f71226b881 /pkg/instance/instance.go
parentbf1cd0b7e8397cb9006d0f37b6ee3eb1ed566076 (diff)
fixed bug in handler path constructionv0.3.1
A path is expected to always start with the '/' character.
Diffstat (limited to 'pkg/instance/instance.go')
-rw-r--r--pkg/instance/instance.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go
index fbfe4df..dc7f5c5 100644
--- a/pkg/instance/instance.go
+++ b/pkg/instance/instance.go
@@ -64,7 +64,10 @@ func (i *Instance) Handlers() []Handler {
// Path returns a path that should be configured for this handler
func (h Handler) Path() string {
- return h.Endpoint.Path(h.Instance.Prefix, "sigsum", "v0")
+ if len(h.Instance.Prefix) == 0 {
+ return h.Endpoint.Path("", "sigsum", "v0")
+ }
+ return h.Endpoint.Path("", h.Instance.Prefix, "sigsum", "v0")
}
// ServeHTTP is part of the http.Handler interface