krakend / krakend-ce

KrakenD Community Edition: High-performance, stateless, declarative, API Gateway written in Go.

Home Page:https://www.krakend.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to handle query string with space character(%20) , getting error

varunnaladham-smc opened this issue · comments

@alombarte , @taik0 , we are having search APIs querying the below end point
/clients/v1/clients?searchScope=global&pageIndex=0&query=Varun%20na

Below is the endpoint config m we are using to pass all the headers , but how ever krakned rejecting the API call with 400 error -
Parameter 'query' must be url encoded. Its value may not contain reserved characters."

Any suggestions to fix this

Endpoint config :
{
"backend": [
{
"extra_config": {
"backend/http": {
"return_error_code": true
}
},
"host": [
"Hostname"
],
"method": "GET",
"url_pattern": "/v1/clients"
}
],
"endpoint": "/clients/v1/clients",
"input_headers": [
""
],
"input_query_strings": [
"
"
],
"method": "GET"
},

Error:
{
"name": "Bad Request",
"status": 400,
"path": ".query.query",
"errors": [
{
"path": ".query.query",
"message": "Parameter 'query' must be url encoded. Its value may not contain reserved characters."
}
]
}

i did some checks , the above error is from backend that its receiving parameters as with "+" sign
/v1/clients?pageIndex=0&query=Varun+na&searchScope=global

source sending me the request as /clients/v1/clients?searchScope=global&pageIndex=0&query=Varun%20na
so Varun%20na got changed to Varun+na