servicestack - Service CORS and Route Attributes -
i have cors feature enabled. i'm finding if don't have:
[route("/cors_endpoint", "get, options")] on request dto, 404.
as i'm using corsfeature, , prerequestfilter below, don't understand 404 coming. (i have authentication attributes in play, doing stateless auth it).
plugins.add(new corsfeature()); prerequestfilters.add((req, res) => { if (req.method == "options") { res.statuscode = 200; //my hack res.endrequest(); } }); any ideas? ps. still on 3.9.x
edit: real questions maybe should be:
[route("/cors_endpoint", "get")] this gives 404, , doesn't hit prerequestfilter @ all. why?
the "new api" changes introduced more http verb signatures. try adding the service options method.
public class reqstarsservice : service { [enablecors] public void options(reqstar request) {} }
Comments
Post a Comment