Skip to content

Commit

Permalink
Fix CORS preflight handling for /v1/workflow-instance
Browse files Browse the repository at this point in the history
  • Loading branch information
eputtone committed Jun 17, 2017
1 parent a2cf0f1 commit 753fee3
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import static java.util.stream.Collectors.toMap;
import static java.util.stream.Collectors.toSet;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static javax.ws.rs.core.MediaType.WILDCARD;
import static javax.ws.rs.core.Response.noContent;
import static javax.ws.rs.core.Response.ok;
import static javax.ws.rs.core.Response.status;
Expand Down Expand Up @@ -37,11 +38,13 @@
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.NotFoundException;
import javax.ws.rs.OPTIONS;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import org.springframework.dao.EmptyResultDataAccessException;
Expand Down Expand Up @@ -105,6 +108,14 @@ public WorkflowInstanceResource(WorkflowInstanceService workflowInstances, Creat
this.workflowInstanceFactory = workflowInstanceFactory;
}

@OPTIONS
@Path("{any: .*}")
@ApiOperation(value = "CORS preflight handling")
@Consumes(WILDCARD)
public Response corsPreflight() {
return Response.ok().build();
}

@PUT
@ApiOperation(value = "Submit new workflow instance")
@ApiResponses(@ApiResponse(code = 201, message = "Workflow was created", response = CreateWorkflowInstanceResponse.class))
Expand Down

0 comments on commit 753fee3

Please sign in to comment.