From 01e085cc64363488d11977e9c6f0e8b6faac5a2c Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Wed, 7 May 2014 15:25:17 -0700 Subject: [PATCH] agent: Correct spelling of separator. Fixes #101. --- CHANGELOG.md | 3 +++ command/agent/kvs_endpoint.go | 6 +++++- website/source/docs/agent/http.html.markdown | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f7be27cd..11338b11d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ FEATURES: BUG FIXES: + * Renaming "seperator" to "separator". This is the correct spelling, + but both spellings are respected for backwards compatibility. [GH-101] + IMPROVEMENTS: * Improved the URL formatting for the key/value editor in the Web UI. diff --git a/command/agent/kvs_endpoint.go b/command/agent/kvs_endpoint.go index c12d647dd..7791d1e9f 100644 --- a/command/agent/kvs_endpoint.go +++ b/command/agent/kvs_endpoint.go @@ -81,12 +81,16 @@ func (s *HTTPServer) KVSGet(resp http.ResponseWriter, req *http.Request, args *s // KVSGetKeys handles a GET request for keys func (s *HTTPServer) KVSGetKeys(resp http.ResponseWriter, req *http.Request, args *structs.KeyRequest) (interface{}, error) { - // Check for a seperator + // Check for a seperator, due to historic spelling error, + // we now are forced to check for both spellings var sep string params := req.URL.Query() if _, ok := params["seperator"]; ok { sep = params.Get("seperator") } + if _, ok := params["separator"]; ok { + sep = params.Get("separator") + } // Construct the args listArgs := structs.KeyListRequest{ diff --git a/website/source/docs/agent/http.html.markdown b/website/source/docs/agent/http.html.markdown index b63bac4bf..25e2c7beb 100644 --- a/website/source/docs/agent/http.html.markdown +++ b/website/source/docs/agent/http.html.markdown @@ -149,8 +149,8 @@ key. It is possible to also only list keys without any values by using the "?keys" query parameter along with a `GET` request. This will return -a list of the keys under the given prefix. The optional "?seperator=" -can be used to list only up to a given seperator. +a list of the keys under the given prefix. The optional "?separator=" +can be used to list only up to a given separator. For example, listing "/web/" with a "/" seperator may return: