diff --git a/path_config.go b/path_config.go index c9e7d5f..c19f0f9 100644 --- a/path_config.go +++ b/path_config.go @@ -3,6 +3,7 @@ package artifactory import ( "context" "fmt" + "strings" "github.com/hashicorp/vault/sdk/framework" "github.com/hashicorp/vault/sdk/logical" @@ -86,6 +87,9 @@ func (b *backend) pathConfigWrite(ctx context.Context, req *logical.Request, dat if config.Address == "" { return logical.ErrorResponse("address must be set"), nil } + if !strings.HasSuffix(config.Address, "/") { + config.Address = config.Address + "/" + } if config.ApiKey != "" && config.Username != "" { return logical.ErrorResponse("provide either api_key or username, not both"), nil }