Access to removed image does not 404 and redirects to a removed.png instead

195 views
Skip to first unread message

cadi...@gmail.com

unread,
Jul 7, 2013, 2:53:17 PM7/7/13
to im...@googlegroups.com
Hi,

If an image (uploaded anonymously) has already been removed, trying to set its URL in the SRC attribute of an image through javascript calls the load event handler and a generic removed.png image is visible. I expected the error handler to be called instead.
So, how can I know in my load handler that something went wrong to act accordingly?

Thanks

rot...@gmail.com

unread,
Jul 25, 2013, 10:11:47 PM7/25/13
to im...@googlegroups.com
Run a test again the header data
i will point out the 302 status the content type and the location
Deleted Image:
HTTP/1.1 302 Moved Temporarily
Server: cloudflare-nginx
Date: Fri, 26 Jul 2013 02:06:19 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d73e714bac63a2cfd2c2bf977a36825b61374804379701; expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/; domain=.imgur.com
Access-Control-Allow-Methods: GET, OPTIONS
Access-Control-Allow-Origin: *
Cache-Control: public, max-age=31536000
Expires: Sat, 26 Jul 2014 02:06:19 GMT
Location: http://i.imgur.com/removed.png
CF-Cache-Status: HIT
CF-RAY: 93d87ad2fe804f5

Good Image:
HTTP/1.1 200 OK
Server: cloudflare-nginx
Date: Fri, 26 Jul 2013 02:06:40 GMT
Content-Type: image/jpeg
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: __cfduid=d0db003f7d7099660cb833a11bcc55c361374804400030; expires=Mon, 23-Dec-2019 23:50:00 GMT; path=/; domain=.imgur.com
Access-Control-Allow-Methods: GET, OPTIONS
Access-Control-Allow-Origin: *
Cache-Control: public, max-age=315360000
Expires: Mon, 24 Jul 2023 02:06:40 GMT
CF-Cache-Status: HIT
CF-RAY: 93d882c3f0e04ef

cadi...@gmail.com

unread,
Jul 25, 2013, 10:17:18 PM7/25/13
to im...@googlegroups.com
Thanks. And how would you test that in the load handler?

rot...@gmail.com

unread,
Jul 25, 2013, 11:10:39 PM7/25/13
to im...@googlegroups.com
if you are using JS you can do this once you get around the same origin issue, i just do that by having a server do it via php

var httpRequest = new XMLHttpRequest();
httpRequest.open('GET', 'http://imgur.com/gallery/2HhJVlT',false);
httpRequest.send(null);
alert(httpRequest.getAllResponseHeaders());

on a side note the last header's value is awesome:
Content-Type: text/html; charset=utf-8
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Content-Encoding: gzip
Content-Length: 8560
Accept-Ranges: bytes
Date: Fri, 26 Jul 2013 03:07:54 GMT
Connection: keep-alive
X-Imgur-Cached: 0
Server: cat factory 1.0

elmoham...@gmail.com

unread,
Jul 13, 2016, 5:58:38 PM7/13/16
to Imgur

elmoham...@gmail.com

unread,
Jul 13, 2016, 6:05:06 PM7/13/16
to Imgur
Reply all
Reply to author
Forward
0 new messages