elastic / sense

A JSON aware developer's interface to Elasticsearch. Comes with handy machinery such as syntax highlighting, autocomplete, formatting and code folding.
Other
381 stars 134 forks source link

URI-encode query string param values before sending request to proxy #152

Closed ycombinator closed 8 years ago

ycombinator commented 8 years ago

Resolves #151

To test this, issue the following request: GET _analyze?tokenizer=standard&text=cat dog

Prior to this PR, this request would fail with the following response:

{
   "statusCode": 400,
   "error": "Bad Request",
   "message": "child \"uri\" fails because [\"uri\" must be a valid uri]",
   "validation": {
      "source": "query",
      "keys": [
         "uri"
      ]
   }
}

With this PR, this request should succeed with the following response:

{
  "tokens": [
    {
      "token": "cat",
      "start_offset": 0,
      "end_offset": 3,
      "type": "<ALPHANUM>",
      "position": 0
    },
    {
      "token": "dog",
      "start_offset": 4,
      "end_offset": 7,
      "type": "<ALPHANUM>",
      "position": 1
    }
  ]
}
spalger commented 8 years ago

LGTM