diff --git a/server/server.go b/server/server.go index e27190d..40b2919 100644 --- a/server/server.go +++ b/server/server.go @@ -111,7 +111,12 @@ func (server *Server) Run(ctx context.Context, options ...RunOption) error { if server.options.EnableRandomUrl { path = "/" + randomstring.Generate(server.options.RandomUrlLength) + "/" } - + if !strings.HasPrefix(path, "/") { + path = "/" + path + } + if !strings.HasSuffix(path, "/") { + path = path + "/" + } handlers := server.setupHandlers(cctx, cancel, path, counter) srv, err := server.setupHTTPServer(handlers) if err != nil {