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: