Implement OPTIONS method for custom routes
ipolevoy opened this issue · comments
so, now you can have any controller:
public class OptionsController extends AppController {
public void index() {
header("Access-Control-Allow-Origin", "http://astalavista.baby");
respond("OptionsController#index");
}
}
and simply define a custom route:
route("/options/blah").to(OptionsController.class).action("index").options();
Within the controller, you can set whatever headers you need