Cross-Origin Image Load denied by Cross-Origin....

Get help using Construct 2

Post » Fri Aug 02, 2013 4:21 am

I am getting this error in the browser in my game even though all the resources are loaded form the same donain , Cross-origin image load denied by Cross-Origin Resource Sharing policy.
http://www.picturehangman.com/chromewebstore/picturehangmanhd/part_bea[email protected]?date=13754132561770.023Failed to load resource: The URL cant be shown

When i do a action Sprite===> Load image from URL i see this problem seems to happen , both the resources are loaded from the same domain.

When i checked the Request headers i see a difference not sure if this is causing because of this ,

Working :

GET [email protected]?date=13753401541170.016493 HTTP/1.1
Host: www.picturehangman.com
Connection: keep-alive
Accept: image/webp,*/*;q=0.8
Origin: http://www.picturehangman.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36
Referer: http://www.picturehangman.com/chromewebstore/picturehangmanhd/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8


HTTP/1.1 200 OK
Date: Thu, 01 Aug 2013 06:55:54 GMT
Server: Apache
Last-Modified: Mon, 29 Jul 2013 02:53:19 GMT
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding: gzip
Content-Length: 8415
Keep-Alive: timeout=10, max=26
Connection: Keep-Alive
Content-Type: image/png


Non-Working (using load image from URL):

GET http://www.picturehangman.com/chromewebstore/picturehangmanhd/part_clo[email protected]?date=13753404597720.016219 HTTP/1.1
Accept: image/webp,*/*;q=0.8
Referer: http://www.picturehangman.com/chromewebstore/picturehangmanhd/
Origin: http://www.picturehangman.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36

It looks the request seems like a proxy request where the domain name is appended in the GET header and the Host header is missing so i think the browser thinks it's a proxy request instead of the regular request even though requests point to same domain (http://www.PictureHangman.com) , it looks like a bug to me ? any ideas on how to fix does Scirra needs to fix it ?

You can also try it out here http://www.picturehangman.com/chromewebstore/picturehangmanhd/
B
16
S
4
Posts: 248
Reputation: 2,267

Post » Fri Aug 02, 2013 7:55 am

I personally use PHP header to allow cross-domain on my server, then it worked everything, even CocoonJS and mobile devices
B
96
S
34
G
29
Posts: 3,138
Reputation: 28,234

Post » Sat Aug 10, 2013 5:18 am

I am selling my game to other publishers , i can't really ask them to set the header , it should work as long as the images are loaded from the same domain which is what i am going in my game and there is no reason for it to fail. I think it's because of how it constructs the request with the FQDN in the GET Header GET http://www.picturehangman.com/chromewebstore/picturehangmanhd/part_clo[email protected]?date=13753404597720.016219 which is like a proxy request than the regular request Where the Host header and the URI without the host is sent like this ,

GET [email protected]?date=13753401541170.016493 HTTP/1.1
Host: www.picturehangman.com

I am thinking it's a bug on how constructs the request.

@Ashley any help ?
B
16
S
4
Posts: 248
Reputation: 2,267

Post » Thu Aug 15, 2013 4:45 am

@tringio well, tell them to use cross-domain, even it's not your problem.
B
96
S
34
G
29
Posts: 3,138
Reputation: 28,234


Return to How do I....?

Who is online

Users browsing this forum: ColombageEnPLS, iBarin, Jhorbam, ninepixels and 15 guests