ajax - Can't get Access-Control-Allow-Origin header to work as I expected -


there lot of questions on subject, still can't seem resolve issue.

i have game i'm trying working html 5 in chrome. link here.

the game written using libgdx , i'm posting json data app engine hosted end. i've done quite bit of reading , think understand issue cross domain access, think understand how resolve can't.

the full error is

xmlhttprequest cannot load http://1-1-51.wordbuzzweb.appspot.com/login. no 'access-control-allow-origin' header present on requested resource. origin 'http://wordbuzzhtml5.appspot.com' therefore not allowed access.

as can see, says no 'access-control-allow-origin' header present on requested resource.. if @ headers requested resource, follows.

date: thu, 18 jun 2015 21:59:34 gmt content-encoding: gzip server: google frontend vary: accept-encoding access-control-allow-methods: get, post content-type: application/json access-control-allow-origin: * alternate-protocol: 80:quic,p=0 cache-control: private access-control-allow-headers: content-type content-length: 127 

as can see, there access-control-allow-origin header included.

if please tell me i'm doing wrong, that'd appreciated.

the request header follows using post method.

host: 192.168.254.1:8081 pragma: no-cache cache-control: no-cache origin: http://localhost:8080/ user-agent: mozilla/5.0 (windows nt 6.1; win64; x64) applewebkit/537.36 (khtml, gecko) chrome/44.0.2403.52 safari/537.36 accept: */* referer: http://localhost:8080/html/ accept-language: en-gb,en;q=0.8 content-length: 25 content-type: application/json 

since getting headers in response, that's indication request reaching server, however, fact isn't hitting server route points problem being request being made doesn't match of routes. request options request rather post request, commonly happens when make cors request browser isn't "simple request".

the solution either make "simple request", or have server respond options requests. it's far easier make server respond options requests, because "simple requests" still send options requests.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -