Advertisement:

Author Topic: Issue with Image Proxy and Imgur.com  (Read 1971 times)

Offline tjbalon

  • Semi-Newbie
  • *
  • Posts: 97
Issue with Image Proxy and Imgur.com
« on: June 15, 2017, 06:15:15 PM »
Not sure if this is reported yet however one of the major image sites, imgur doesn't seem to be working with the image proxy currently.

Example:
https://tangoworldwide.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FJC0yC6o.png&hash=63a432f67bd39c8aa12c3865d25df0c3

This is a proxy pass via our website which is breaking the image, however that image: https://i.imgur.com/JC0yC6o.png surely exists.

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 48,961
Re: Issue with Image Proxy and Imgur.com
« Reply #1 on: June 16, 2017, 05:10:48 AM »


are you sure it is not working? it seems to be working in the above image.

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 4,661
  • Gender: Male
    • i30 Owners Club
Re: Issue with Image Proxy and Imgur.com
« Reply #2 on: June 16, 2017, 05:39:32 AM »
The request is being passed to the proxy code as http not https, which is why imgur is rejecting it.

Changing the request code to include the missing "s" causes it to function correctly.

https://tangoworldwide.net/proxy.php?request=https%3A%2F%2Fi.imgur.com%2FJC0yC6o.png&hash=63a432f67bd39c8aa12c3865d25df0c3

Something in 2.0.14 is changing it along the way.

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 4,661
  • Gender: Male
    • i30 Owners Club

Online Gluz

  • Native Language Support Specialist
  • Sr. Member
  • *
  • Posts: 985
  • Gender: Male
Re: Issue with Image Proxy and Imgur.com
« Reply #4 on: June 16, 2017, 04:46:38 PM »
If the image is https then it doesn't need to use the proxy at all.
Need help with PHP, HTML, CSS, Themes or MODs?

Quote
Think in spanish, habla en inglés.

Offline tjbalon

  • Semi-Newbie
  • *
  • Posts: 97
Re: Issue with Image Proxy and Imgur.com
« Reply #5 on: June 17, 2017, 06:42:16 AM »

Offline tjbalon

  • Semi-Newbie
  • *
  • Posts: 97
Re: Issue with Image Proxy and Imgur.com
« Reply #6 on: June 17, 2017, 05:16:00 PM »
If the image is https then it doesn't need to use the proxy at all.

Also this is not true, you can still use things such as:
https://zacharydubois.me/sig.php

Leaking user IPs is possible if you are not filtering all images.

Offline tjbalon

  • Semi-Newbie
  • *
  • Posts: 97
Re: Issue with Image Proxy and Imgur.com
« Reply #7 on: June 17, 2017, 05:52:17 PM »
Sorry for a triple post, not letting me modify... Anyhow,

1. Implementing a change to Subs for just imgur.com works, but hard coding is very sloppy.

2. The issue remains at this time, and I'm not sure why. Is this only because of how imgur does it's links?

3. Is there any other fix for this as of now, or can someone take a second look (hopefully Sleepy).

4. It is happening in avatars too, so if I implement the change in Subs that does not fix everything.

Here's a better example:
Link: http//i.imgur.com/5zMGjbH.png
Proxy: https://tangoworldwide.net/proxy.php?request=http%3A%2F%2Fi.imgur.com%2F5zMGjbH.png&hash=ac115fe07253dd3b7153f53ddadf0134

If I build the link off the proxy by                                     ^ here                     ^ here                 ^ here
I get back: http//i.imgur.com/5zMGjbH.png

Which will load without the proxy?
« Last Edit: June 17, 2017, 06:03:31 PM by balonfx »

Online Gluz

  • Native Language Support Specialist
  • Sr. Member
  • *
  • Posts: 985
  • Gender: Male
Re: Issue with Image Proxy and Imgur.com
« Reply #8 on: June 17, 2017, 08:08:58 PM »
If the image is https then it doesn't need to use the proxy at all.

Also this is not true, you can still use things such as:
https://zacharydubois.me/sig.php

Leaking user IPs is possible if you are not filtering all images.

I mean, the mere use of the proxy for a secure (https) site is that for any image that is not https the browser will mark the site as insecure by mixed content, so the proxy act as an intermediary to load the image from an https source. If the image is https in first place, it doesn't need to use the proxy, and if it's using it it's because something is wrong.

And that PHP script that generates an image is a pretty basic whatsmyip, it just shows your own public IP address and nothing more, and even if it's collecting all the IP's from where it's loaded, it can't use them for anything because it have no other information. And it's from an https source, so it shouldn't go through the proxy.

In your last example, the image on imgur doesn't even load, it says that the page isn't redirecting properly. So, it should be a redirection problem, as stated in this post and the fix in here should work if the url is from a valid image.
Need help with PHP, HTML, CSS, Themes or MODs?

Quote
Think in spanish, habla en inglés.

Offline tjbalon

  • Semi-Newbie
  • *
  • Posts: 97
Re: Issue with Image Proxy and Imgur.com
« Reply #9 on: June 17, 2017, 08:16:33 PM »
Apologies Gluz,

http://i.imgur.com/5zMGjbH.png

Is the correct link, forgot the :

This is a new bug by the way, randomly appeared a few days ago with no code edits.

Online Gluz

  • Native Language Support Specialist
  • Sr. Member
  • *
  • Posts: 985
  • Gender: Male
Re: Issue with Image Proxy and Imgur.com
« Reply #10 on: June 18, 2017, 04:19:00 PM »
What I've seen is that some times large images doesn't load right away, the proxy caching take some time, more than it should be (I think), and for imgur, it displays the image that says that not exists or is no longer available, but I tested in my forum and it does load that image, http with the proxy and https without the proxy, so, I don't know how it's reproducible on some forums and not in others.
Need help with PHP, HTML, CSS, Themes or MODs?

Quote
Think in spanish, habla en inglés.

Offline tjbalon

  • Semi-Newbie
  • *
  • Posts: 97
Re: Issue with Image Proxy and Imgur.com
« Reply #11 on: June 18, 2017, 05:10:37 PM »
I might do a sloppy fix to replace http to https if it is imgur.

But wish I could do it another way if anyone can help out here. Not sure what's causing it JUST with imgur but I have bug reports like crazy from our members.

I'll also need to find out where this works in the avatars displaying as well to pass through image proxy.
--
Originally, I shut caching entirely but now I've lifted it up to 8192kb but it's the same issue.
« Last Edit: June 18, 2017, 05:50:41 PM by balonfx »

Online Gluz

  • Native Language Support Specialist
  • Sr. Member
  • *
  • Posts: 985
  • Gender: Male
Re: Issue with Image Proxy and Imgur.com
« Reply #12 on: June 18, 2017, 06:43:26 PM »
Yeah, a fix to change all the imgur to https automatically is the best bet IMO, like with the censored words, so every time a user post a image http from imgur, it will automatically replace it with the https and then no need to use the proxy at all.

For the avatars, I personally don't like the external URL, I rather give them the option to upload the image to the forum, or make it so the forum download the image from the URL, that way it doesn't rely on external sites every time.
Need help with PHP, HTML, CSS, Themes or MODs?

Quote
Think in spanish, habla en inglés.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,361
    • Arantor on GitHub
Re: Issue with Image Proxy and Imgur.com
« Reply #13 on: June 19, 2017, 01:30:53 AM »
Guess you've never had takedown notices over copyrighted images being used as avatars ;)
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Online Gluz

  • Native Language Support Specialist
  • Sr. Member
  • *
  • Posts: 985
  • Gender: Male
Re: Issue with Image Proxy and Imgur.com
« Reply #14 on: June 19, 2017, 10:26:23 AM »
Not for copyrighted​ images, just for a couple of links of video material licenced in Spain, that we take down even that we are from various parts of Latin America and it's not available in any way, shape or form here, and that's the most common takedown notices in the kind of forums I run, for the videos linked, as it could be considered an illegal download.
Need help with PHP, HTML, CSS, Themes or MODs?

Quote
Think in spanish, habla en inglés.

Offline tjbalon

  • Semi-Newbie
  • *
  • Posts: 97
Re: Issue with Image Proxy and Imgur.com
« Reply #15 on: June 19, 2017, 02:02:54 PM »
Guess you've never had takedown notices over copyrighted images being used as avatars ;)

Arantor do you have any clue what would cause this issue with imgur on our website? You've helped me numerous other times haha hoping someone says something that I'm missing here. I still don't understand what specifically is messing up, unless it's 100% on the Imgur side of re-direction.

Offline @rjen

  • Jr. Member
  • **
  • Posts: 216
  • Gender: Male
    • FJR-club Nederland
Re: Issue with Image Proxy and Imgur.com
« Reply #16 on: June 19, 2017, 04:20:29 PM »
I just posted your image link into my test forum and it works without problems.

Did you try this fix?  https://www.simplemachines.org/community/index.php?topic=553901.msg3926548#msg3926548

That resolved my problems with proxy images not showing...

Open $sourcedir/Class-CurlFetchWeb.php

Find:
Code: [Select]
$this->headers[strtolower($temp[0])] = strtolower(trim($temp[1]));

Replace:
Code: [Select]
$this->headers[strtolower($temp[0])] = trim($temp[1]);

Note, that this code may end up being the patched code in the next release.  If so, you would need to revert it prior to applying the next release.
Running SMF 2.0 with Tinyportal 1.4.1 at www.fjr-club.nl
Testing SMF 2.1 beta 4 with Tinyportal 2.0 at http://test2.fjr-club.nl/

Offline tjbalon

  • Semi-Newbie
  • *
  • Posts: 97
Re: Issue with Image Proxy and Imgur.com
« Reply #17 on: June 19, 2017, 09:36:38 PM »
Yes rjen, I tried this and it still did not work.