So I grabbed a copy of Wireshark and captured attempts to access the same image file on the same server. One via FireFox and another via the simulator. The Firefox worked, the simulator failed due to a supposed priv error 403. The kick is I had full privs open - 777 and obviously the browser had no problem on port 80, only the simulator. Below are the HTTP protocol captures and there are some differences.
I even tried renaming the image file form .jpg to .htm - no change
I tried moving the image file between the web root and images folder - no change
Firefox (successful image retrieval)
Hypertext Transfer Protocol
GET /images/license.jpg HTTP/1.1\r\n
[Expert Info (Chat/Sequence): GET /images/license.jpg HTTP/1.1\r\n]
[Message: GET /images/license.jpg HTTP/1.1\r\n]
[Severity level: Chat]
[Group: Sequence]
Request Method: GET
Request URI: /images/license.jpg
Request Version: HTTP/1.1
Host: www.kensteinberg.com\r\n
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0\r\n
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n
Accept-Language: en-US,en;q=0.5\r\n
Accept-Encoding: gzip, deflate\r\n
DNT: 1\r\n
Connection: keep-alive\r\n
\r\n
Full request URI: [http://www.kensteinberg.com/images/license.jpg]
[HTTP request 1/1]
Hypertext Transfer Protocol
GET /images/license.jpg HTTP/1.1\r\n
[Expert Info (Chat/Sequence): GET /images/license.jpg HTTP/1.1\r\n]
[Message: GET /images/license.jpg HTTP/1.1\r\n]
[Severity level: Chat]
[Group: Sequence]
Request Method: GET
Request URI: /images/license.jpg
Request Version: HTTP/1.1
Connection: Keep-Alive\r\n
Host: www.kensteinberg.com\r\n
\r\n
Full request URI: [http://www.kensteinberg.com/images/license.jpg]
[HTTP request 1/1]
[Response in frame: 11]
Simulator (erroneous retrieval)
Interestingly when I use the coronalab url from the AsyncImageDownload sample in Firefox, I get an immediate 304 after the HTTP GET
Hypertext Transfer Protocol
GET /demo/hello.png HTTP/1.1\r\n
[Expert Info (Chat/Sequence): GET /demo/hello.png HTTP/1.1\r\n]
Request Method: GET
Request URI: /demo/hello.png
Request Version: HTTP/1.1
Host: developer.coronalabs.com\r\n
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0\r\n
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n
Accept-Language: en-US,en;q=0.5\r\n
Accept-Encoding: gzip, deflate\r\n
DNT: 1\r\n
[truncated] Cookie: optimizelySegments=%7B%7D; optimizelyEndUserId=oeu1394367114444r0.3002637
7671530735; optimizelyBuckets=%7B%7D; __utma=102512659.222183461.1394367115.1398189649.1398204069
.83; __utmz=102512659.1397993086.68.43.utmcsr=goo
Connection: keep-alive\r\n
If-Modified-Since: Fri, 01 Apr 2011 05:33:04 GMT\r\n
If-None-Match: “6e03a-aec-49fd4be740400”\r\n
Cache-Control: max-age=0\r\n
\r\n
Full request URI: [http://developer.coronalabs.com/demo/hello.png]
[HTTP request 1/1]
[Response in frame: 6]
No. Time Source Destination Protocol Length Info
6 0.147423000 96.126.119.88 192.168.1.11 HTTP 225 HTTP/1.1 304 N
ot Modified
Frame 6: 225 bytes on wire (1800 bits), 225 bytes captured (1800 bits) on interface 0
Ethernet II, Src: Netgear_22:66:ff (04:a1:51:22:66:ff), Dst: IntelCor_59:da:14 (00:23:15:59:da:14
)
Internet Protocol Version 4, Src: 96.126.119.88 (96.126.119.88), Dst: 192.168.1.11 (192.168.1.11)
Transmission Control Protocol, Src Port: http (80), Dst Port: 52371 (52371), Seq: 1, Ack: 1037, L
en: 171
Hypertext Transfer Protocol
HTTP/1.1 304 Not Modified\r\n
[Expert Info (Chat/Sequence): HTTP/1.1 304 Not Modified\r\n]
Request Version: HTTP/1.1
Status Code: 304
Response Phrase: Not Modified
Date: Tue, 22 Apr 2014 22:07:57 GMT\r\n
Server: Apache\r\n
Connection: Keep-Alive\r\n
Keep-Alive: timeout=5, max=100\r\n
ETag: “6e03a-aec-49fd4be740400”\r\n
\r\n
[HTTP response 1/1]
[Time since request: 0.075544000 seconds]
[Request in frame: 5]
Conclusion, To be honest, I’m not sure. Could it be the server looking for an identified UserAgent? Both servers (mine and coronalab) are Apache. Of course the configs could be different.
I am stumped that this simple sample app blows up when a new server is used, regardless of server or host.