Freeboard Stuff

Freeboard is one of these things that works really well and you want to bite the back of your hand when you get stuff working.

I had this issue though when developing some local web services with SparkJava and testing them on my local machine with localhost

I was using Chrome. Seems like Chrome doesnt support CORS on localhost. I used IE and Edge and it worked. I was building some simple web services and Java and by adding the following headers it worked fine.

res.header(“Access-Control-Allow-Origin” ,”*”);
res.header(“Access-Control-Allow-Credentials”,” true “);
res.header(“Access-Control-Allow-Methods”,” OPTIONS, GET, POST”);
res.header(“Access-Control-Allow-Headers”, “Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control”);

http://stackoverflow.com/questions/3136140/cors-not-working-on-chrome
http://stackoverflow.com/questions/10883211/deadly-cors-when-http-localhost-is-the-origin

Advertisements