URL encode search in web UI

Fixes #986
This commit is contained in:
Alex Krantz 2020-10-05 11:57:52 -07:00
parent 4398f2c023
commit 726e867058
No known key found for this signature in database
GPG Key ID: B1EA6CED0A510374

View File

@ -203,7 +203,7 @@
if (e.selectedIndex == -1) { return } if (e.selectedIndex == -1) { return }
var index = e.options[e.selectedIndex].value; var index = e.options[e.selectedIndex].value;
let theUrl = `${baseUrl}/indexes/${index}/search?q=${search.value}&attributesToHighlight=*`; let theUrl = `${baseUrl}/indexes/${index}/search?q=${encodeURIComponent(search.value)}&attributesToHighlight=*`;
if (lastRequest) { lastRequest.abort() } if (lastRequest) { lastRequest.abort() }
lastRequest = new XMLHttpRequest(); lastRequest = new XMLHttpRequest();