Skip to content

Commit

Permalink
Committing a quick CORS header fix into the patch branch.
Browse files Browse the repository at this point in the history
Will update #1136 to reflect this.
  • Loading branch information
landreev committed May 11, 2016
1 parent d711374 commit 43e2193
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/api/Search.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
import javax.json.Json;
import javax.json.JsonArrayBuilder;
import javax.json.JsonObjectBuilder;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import org.apache.commons.lang.StringUtils;

Expand Down Expand Up @@ -65,7 +67,8 @@ public Response search(
@QueryParam("fq") final List<String> filterQueries,
@QueryParam("show_entity_ids") boolean showEntityIds,
@QueryParam("show_api_urls") boolean showApiUrls,
@QueryParam("show_my_data") boolean showMyData
@QueryParam("show_my_data") boolean showMyData,
@Context HttpServletResponse response
) {

User user;
Expand Down Expand Up @@ -182,6 +185,7 @@ public Response search(
*/
return errorResponse(Response.Status.BAD_REQUEST, solrQueryResponse.getError());
}
response.setHeader("Access-Control-Allow-Origin", "*");
return okResponse(value);
} else {
return errorResponse(Response.Status.BAD_REQUEST, "q parameter is missing");
Expand Down

0 comments on commit 43e2193

Please sign in to comment.