Origin http://127.0.0.1:8888 is not allowed by Access-Control-Allow-Origin – GWT Debugging

During GWT debugging, if you are making a RequestBuilder on a different domain without using JSONP, you may have this problem.
To fix it you must configure Header in order to accept requests from other domains. In Apache HTTP Server you can set them in the VirtualHost configuration of bar.com using the directive Header set.

 
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "X-Requested-With"

Or better filtering by your origin – see also https://developer.mozilla.org/En/HTTP_access_control#Access-Control-Allow-Origin


Header set Access-Control-Allow-Origin "http://foo.com"
Header set Access-Control-Allow-Headers "X-Requested-With"

Leave a comment