989: URL encode search in web UI r=LegendreM a=akrantz01

Fixes #986 

Co-authored-by: Alex Krantz <alex@krantz.dev>
This commit is contained in:
bors[bot] 2020-10-06 15:28:46 +00:00 committed by GitHub
commit b406b6ee44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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();