summaryrefslogtreecommitdiff
path: root/htroot/IndexControlURLs_p.html
diff options
context:
space:
mode:
authorluccioman <luccioman@users.noreply.github.com>2016-11-25 11:10:03 +0100
committerluccioman <luccioman@users.noreply.github.com>2016-11-25 11:13:16 +0100
commit89017e17e4f92bafe55e9891241ace3aee71d70d (patch)
treebf66046509183e7b2e8fa307907fc037140f594e /htroot/IndexControlURLs_p.html
parentfc575fc7600e2e9621f0b9f9344181b8da706c69 (diff)
Converted ajax URL to relative and added a check on the response status.
This makes YaCy easier to configure when running behind a reverse Proxy. The check on status avoids trying to update the page with error text content when the server returned a 404 or 500 error message for example.
Diffstat (limited to 'htroot/IndexControlURLs_p.html')
-rw-r--r--htroot/IndexControlURLs_p.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/htroot/IndexControlURLs_p.html b/htroot/IndexControlURLs_p.html
index 598341f61..d1d5964ea 100644
--- a/htroot/IndexControlURLs_p.html
+++ b/htroot/IndexControlURLs_p.html
@@ -21,10 +21,10 @@ function search(query) {
else if (window.ActiveXObject) { // IE
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
- self.xmlHttpReq.open('GET', "/solr/select?q=sku:\"" + query + "\" OR host_s:\"" + query + "\" OR host_dnc_s:\"" + query + "\" OR host_organization_s:\"" + query + "\" OR host_organizationdnc_s:\"" + query + "\" OR host_subdomain_s:\"" + query + "\" OR url_paths_sxt:\"" + query + "\" OR url_file_name_s:\"" + query + "\"&start=0&rows=100&wt=yjson", true);
+ self.xmlHttpReq.open('GET', "solr/select?q=sku:\"" + query + "\" OR host_s:\"" + query + "\" OR host_dnc_s:\"" + query + "\" OR host_organization_s:\"" + query + "\" OR host_organizationdnc_s:\"" + query + "\" OR host_subdomain_s:\"" + query + "\" OR url_paths_sxt:\"" + query + "\" OR url_file_name_s:\"" + query + "\"&start=0&rows=100&wt=yjson", true);
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
self.xmlHttpReq.onreadystatechange = function() {
- if (self.xmlHttpReq.readyState == 4) {
+ if (self.xmlHttpReq.readyState == 4 && self.xmlHttpReq.status == 200) {
updatepage(self.xmlHttpReq.responseText);
}
}