Closed gamerhost31 closed 2 years ago
I was setting the request header. Please guide me to set response header.
Update
I have added Custom method to response headers in DefaultRoute using
ctx.Response.Headers["Access-Control-Allow-Methods"] = "RDSERVICE";
It is working fine with GET Request but when i try sending OPTIONS request it shows default methods i.e OPTIONS, HEAD , GET, PUT, POST, DELETE
Did you try overloading Routes.Preflight
?
I didn't try that. please give an example for that
You can see the default implementation here: https://github.com/jchristn/WatsonWebserver/blob/653fd49292faefe009a29acdcaaae81d715d69de/WatsonWebserver/WatsonWebserverRoutes.cs#L185
I'm try to set Access-Control-Allow-Methods with a custom http request method types but it does not show on actual response headers
Custom Method : "RDSERVICE"
WebServer.Settings.Headers["Access-Control-Allow-Methods"] = "RDSERVICE";