×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




CROSS POSTED from midrange-l

Yes, since I'm using express I was able to set the response headers
via the app.use method and working fine:

res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");

Thanks


Keith

Pete Helgren wrote:


One workaround I use when I am too lazy to code a callback is to add some header entries like so (in a >>Java servlet serving JSON)

response.setContentType("application/json");
response.addHeader("X-XSS-Protection", "0");
response.addHeader("Access-Control-Allow-Origin", "*");

You can use whatever implementation you need for the server type you are using.

You can also have Apache handle this if you are using Apache as a reverse proxy.....



On 2/7/2017 2:48 PM, Keith McCully wrote:

I have a Ajax client forwarding requests to a node.js server running
on the IBM i. However, as expected, I get the "No
Access-Control-Allow-Origin header on the requested resource" error.

This is due my laptop client app being in a different domain to the
node.js server on the i. Although both domains are within our estate.

I don't want to go the inelegant JSONP route with the call back but
would prefer to control from the i via CORS but has anyone done this
and be prepared to share some detail?

Thanks,

Keith

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.