i've build restful web service using nancyfx i'm trying post separate domain. of course when that, see failed options message in console because cross site post , need ensure nancy responds correctly options message being sent browser. however, when define route in nancy module:
this.options["/options/"] = _ => this.optionsrequest(); private dynamic optionsrequest() { return this.response.asjson(request) .withheader("access-control-allow-origin", "*") .withheader("access-control-allow-methods", "post") .withheader("access-control-allow-headers", "accept, origin, content-type"); } the code never gets hit. can set breakpoint on optionsrequest() method in debugger , see code never getting hit. can issue options request in postman, , server returns response (interestingly, seems return response uris, not /options/ route i've defined).
is there default nancy options behaviour have override in order specify routes options, or service being hosted in visual studio development web server (casini)? i've tried can think of , i'm still stumped why can't define behaviour particular verb.
turns out bug in nancy v0.17.1 (see https://github.com/nancyfx/nancy/pull/1093). upgrading 0.18.0 fixed issue , allowed options route work correctly.
Comments
Post a Comment