Skip to content

Commit

Permalink
add slash into path for recursive requests
Browse files Browse the repository at this point in the history
  • Loading branch information
lomik committed Nov 9, 2017
1 parent 95d22e0 commit c455bd6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/http"
"net/url"
"strconv"
"strings"
"sync"
"time"
)
Expand Down Expand Up @@ -138,6 +139,10 @@ func Recursive(v bool) Option {

if v {
q.Set("recursive", "true")

if !strings.HasSuffix(r.url.Path, "/") {
r.url.Path += "/"
}
} else {
q.Del("recursive")
}
Expand Down

0 comments on commit c455bd6

Please sign in to comment.