Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
added jsonp to suggest servlet
Michael Peter Christen785781253e32
diff --git a/htroot/suggest.java b/htroot/suggest.javaindex 441505299..552b0e601 100644--- a/htroot/suggest.java+++ b/htroot/suggest.java@@ -102,6 +102,16 @@ public class suggest {prop.putHTML("query", originalquerystring);}+ // check for JSONP+ if ( post.containsKey("callback") ) {+ final String jsonp = post.get("callback") + "([";+ prop.put("jsonp-start", jsonp);+ prop.put("jsonp-end", "])");+ } else {+ prop.put("jsonp-start", "");+ prop.put("jsonp-end", "");+ }+// Adding CORS Access header for xml outputif (xml) {final ResponseHeader outgoingHeader = new ResponseHeader(200);diff --git a/htroot/suggest.json b/htroot/suggest.jsonindex fab9e4743..222c110c3 100644--- a/htroot/suggest.json+++ b/htroot/suggest.json@@ -1 +1 @@-["#[query]#",[#{suggestions}#"#[text]#"#(eol)#,::#(/eol)##{/suggestions}#]]+#[jsonp-start]#["#[query]#",[#{suggestions}#"#[text]#"#(eol)#,::#(/eol)##{/suggestions}#]]#[jsonp-end]#\ No newline at end of file