I’m experimenting with Backbone.js Models to access Neo4j content. I can’t understand why the following communication is failing cross-origin checks:
First the OPTIONS request:
Request URL:http://localhost:7474/db/data/cypher
Request Method:OPTIONS
Status Code:204 No Content
Request Headers
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Access-Control-Request-Headers:origin, content-type, accept
Access-Control-Request-Method:POST
Connection:keep-alive
Host:localhost:7474
Origin:http://localhost:3000
Referer:http://localhost:3000/test/
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11
Response Headers
Access-Control-Allow-Headers:origin, content-type, accept
Access-Control-Allow-Methods:POST
Access-Control-Allow-Origin:*
Allow:OPTIONS,POST
Server:Jetty(6.1.25)
Then the POST request:
Request URL:http://localhost:7474/db/data/cypher
Request Headers
Accept:application/json, text/javascript, */*; q=0.01
Content-Type:application/json
Origin:http://localhost:3000
Referer:http://localhost:3000/test/
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.47 Safari/536.11
Request Payload
start n=node(0) match n-[:hasClass]->c where c.className=Collection return c
And I get console errors:
OPTIONS http://localhost:7474/db/data/cypher 204 (No Content) jquery-1.7.2.min.js:4
XMLHttpRequest cannot load http://localhost:7474/db/data/cypher. Origin http://localhost:3000 is not allowed by Access-Control-Allow-Origin.
As far as I can tell, the request should be allowed, since the preflight request said that Access-Control-Allow-Origin: *. Any suggestions? Is there something I’m missing?
Thanks!
It looks like you are using Chrome and I think this bug might be related.