1

Judging by the comments on issue 554, I would think that Fusion Tables had support for CORS requests. Trying the following though gives a cross site error (in Chrome):

xhr = new XMLHttpRequest()
xhr.open("GET","http://www.google.com/fusiontables/api/query?sql=SELECT%20*%20FROM%201906375")
xhr.send()

The error is: Origin http://[domain] is not allowed by Access-Control-Allow-Origin.

The following example works fine (for comparison), a simple PHP page where I set the "CORS" header and echo the origin server back like, "hello example.com":

xhr = new XMLHttpRequest()
xhr.open("GET","http://skipperkongen.dk/services/corstest/hellocors.php")
xhr.send()

I must admit that I've found nowhere on the web that explicitly says that fusion tables supports CORS, but I kind of expect it (judging also by the comments in the issue)...

Am I doing it wrong?

3
  • Here's a curl request that shows that the Access-Control-Allow-Origin header is not returned on the response. However I know nothing of the status of CORS support in Fusion Tables: curl -H "Origin: foobar.com" -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1" "google.com/fusiontables/api/query?sql=SELECT%20*%20FROM%201906375" --verbose
    – monsur
    Oct 21, 2011 at 12:06
  • Hmm yes, that was my conclusion as well. I find it a bit odd, it would be so easy to stick that Access-Control-Allow-Origin header on the responses, and it would improve the product a great deal IMO. Oct 26, 2011 at 19:50
  • Btw, guess you looked at my homepage :-) choice of User-agent. Well, glad someone read it. Oct 26, 2011 at 19:57

1 Answer 1

2

The headers were updated only for the (undocumented and subject to change) JSONP interface:

http://www.google.com/fusiontables/api/query?sql=&jsonCallback=

1
  • 1
    To me, that seems like a wierd choice? Since CORS and JSONP both accomplish the same thing, namely cross site javascript web service calls. CORS would have value exactly on the non-JSONP interface, IMO. Thanks for your answer :-) Nov 28, 2011 at 9:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.