Custom headers in response

May 24, 2015 at 5:36 PM
Edited May 24, 2015 at 5:48 PM
Hi all,

I am using the SDK to implement some kind of Web Services for a web application written using AngularJS, everything seems to be working fine but now I foud that I am not able to make requests to the WS due to the CORS policiy.

I saw this about how to manage this situations.

My question is... is possible to modify the requests that the http listener sends to the client?

Basically I need to return this header:
Access-Control-Allow-Origin: *
May 29, 2015 at 2:57 AM
Hi albpara,

You have full control over the HTTP response that you send to each client request with the http_listener. Specifically for headers take a look at the http_response::headers() function. It returns a reference to the http_headers for the response, you then add and set whatever headers you want.