Fixed a bug where search terms with spaces didn't work
This commit is contained in:
parent
962ba5efc7
commit
d06263cff7
1 changed files with 4 additions and 0 deletions
|
@ -439,6 +439,10 @@ fn search(request: &mut Request, db: &DB) -> IronResult<Response> {
|
||||||
.url
|
.url
|
||||||
.path()
|
.path()
|
||||||
.join(&::std::path::MAIN_SEPARATOR.to_string());
|
.join(&::std::path::MAIN_SEPARATOR.to_string());
|
||||||
|
let query = match percent_decode(query.as_bytes()).decode_utf8() {
|
||||||
|
Ok(s) => s,
|
||||||
|
Err(_) => return Err(Error::from(ErrorKind::EncodingError).into()),
|
||||||
|
};
|
||||||
let search_result = index::search(db, &query)?;
|
let search_result = index::search(db, &query)?;
|
||||||
let result_json = serde_json::to_string(&search_result);
|
let result_json = serde_json::to_string(&search_result);
|
||||||
let result_json = match result_json {
|
let result_json = match result_json {
|
||||||
|
|
Loading…
Add table
Reference in a new issue