/** Execute a GET or POST request by injecting and running the appropriate {@link Action}. */
@Override
public void service(HttpServletRequest request, HttpServletResponse response) throws IOException {
// The poorly named method getRequestURI gives the path.
RegisteredAction registeredAction = DELEGATOR.getRegisteredAction(request.getRequestURI());
Action action = registeredAction.getAction();
String origin = request.getHeader(ORIGIN);
String method = request.getMethod();
if (!(("GET".equals(request.getMethod()) && action instanceof GetAction)
|| ("POST".equals(request.getMethod()) && action instanceof PostAction)
|| ("OPTIONS".equals(method) && origin != null))) {