Skip to content

Commit

Permalink
handle empty paths in NewOptions()
Browse files Browse the repository at this point in the history
  • Loading branch information
francoismichel committed Jan 3, 2024
1 parent 2c12103 commit 366a400
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type Options struct {
}

func NewOptions(username string, hostname string, port int, urlPath string, authMethods []interface{}) (*Options, error) {
if urlPath[0] != '/' {
if len(urlPath) == 0 || urlPath[0] != '/' {
urlPath = "/" + urlPath
}
return &Options{
Expand Down

0 comments on commit 366a400

Please sign in to comment.