Skip to content

Commit d78ed09

Browse files
committedDec 27, 2015
Strip trailing slash from provided host(s)
1 parent 9d16d66 commit d78ed09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/index.coffee

+2-2
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,13 @@ class Etcd
260260
[options, callback]
261261

262262
# Make sure hosts is a list, make sure all have protocol added
263-
# defaults to http
263+
# defaults to http and remove trailing slash
264264
_cleanHostList: (hosts) ->
265265
hostlist = if _.isArray(hosts) then hosts else [hosts]
266266
hostlist.map (host) ->
267267
url = new URL(host)
268268
url.set 'protocol', 'http:' if url.protocol is ''
269-
url.href
269+
url.href.replace /\/$/, "" # Trailing slash
270270

271271

272272
exports = module.exports = Etcd

0 commit comments

Comments
 (0)
Please sign in to comment.