mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
added jsonp to suggest servlet
This commit is contained in:
parent
0e87a99ab8
commit
785781253e
|
@ -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 output
|
||||
if (xml) {
|
||||
final ResponseHeader outgoingHeader = new ResponseHeader(200);
|
||||
|
|
|
@ -1 +1 @@
|
|||
["#[query]#",[#{suggestions}#"#[text]#"#(eol)#,::#(/eol)##{/suggestions}#]]
|
||||
#[jsonp-start]#["#[query]#",[#{suggestions}#"#[text]#"#(eol)#,::#(/eol)##{/suggestions}#]]#[jsonp-end]#
|
Loading…
Reference in New Issue
Block a user