Commit 9698d361 authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Remove single & double quotes from queries to ensure that query parser doesn't fail.

parent 0d97ab45
......@@ -70,7 +70,9 @@ impl_web!{
#[get("/issuers")]
#[content_type("application/json")]
fn list(&self, query_string: SearchQuery) -> Result<ListResponse, ()> {
let q = query_string.q.trim();
let q = query_string.q.replace("'", " ");
let q = q.replace("\"", " ");
let q = q.trim();
let query = if q.is_empty() {
Box::new(AllQuery)
} else {
......@@ -109,7 +111,9 @@ impl_web!{
#[get("/issuers/autocomplete")]
#[content_type("application/json")]
fn autocomplete(&self, query_string: SearchQuery) -> Result<AutocompleteResponse, ()> {
let q = query_string.q.trim();
let q = query_string.q.replace("'", " ");
let q = q.replace("\"", " ");
let q = q.trim();
let query = if q.is_empty() {
Box::new(AllQuery)
} else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment