Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Commit

Permalink
s/callback/jsonp for clarity.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Newson committed Jul 11, 2009
1 parent 358ec1f commit 03c9f8b
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -68,7 +68,7 @@ public final class SearchRequest {

private final boolean rewrite_query;

private final String callback;
private final String jsonp;

private final String ifNoneMatch;

Expand All @@ -86,7 +86,7 @@ public SearchRequest(final JSONObject obj, final String viewsig) throws ParseExc
this.debug = query.optBoolean("debug", false);
this.include_docs = query.optBoolean("include_docs", false);
this.rewrite_query = query.optBoolean("rewrite", false);
this.callback = query.optString("callback");
this.jsonp = query.optString("jsonp");

// Parse query.
this.q = Config.QP.parse(query.getString("q"));
Expand Down Expand Up @@ -255,8 +255,8 @@ public String execute(final IndexSearcher searcher) throws IOException {
headers.put("Content-Type", "text/plain");
result.put("body", escape(json.toString(2)));
} else {
if (callback != null)
result.put("json", String.format("%s(%s)", callback, json));
if (jsonp != null)
result.put("json", String.format("%s(%s)", jsonp, json));
else
result.put("json", json);
}
Expand Down

0 comments on commit 03c9f8b

Please sign in to comment.