Unable to get Access-Control-Allow-Origin header to work as I expected

There are many questions on this, but I still can not solve my problem.

I have a game in which I am trying to work with HTML 5 in Chrome. Link here .

The game is written using libgdx and I send json data from my host running on my device. I have done quite a bit of reading, and I think I understand the problem with cross-domain access, I also think I understand how to solve it, but I can’t.

Complete mistake

XMLHttpRequest cannot load http://1-1-51.wordbuzzweb.appspot.com/Login . The requested resource does not have an Access-Control-Allow-Origin header. Origin ' http://wordbuzzhtml5.appspot.com ' is therefore not allowed.

As you can see, this says that the No header 'Access-Control-Allow-Origin' is present on the requested resource. . But if I look at the headers for the requested resource, they look like this.

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 you can see, there is an Access-Control-Allow-Origin header .

If someone can tell me what I'm doing wrong, that would be appreciated.

The request header is as follows using the 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, like 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
0
1

, , IS , , , , , , . t . OPTIONS, POST, , CORS , " ".

, " ", OPTIONS. OPTIONS, " " - OPTIONS.

+2

All Articles