Problems with using Curl follow location feature in safe_mode or when open_basedir is enabled

88 views
Skip to first unread message

Alexander Obuhovich

unread,
May 17, 2012, 4:06:53 AM5/17/12
to In-Portal Bugs
Curl is wonderful program, that allows to make requests to any other website via http and https protocols and get requested data.
These days, when CDN are very popular the url you're trying to reach will most likely redirect you to equivalent url, but located closer to you. This will allow to speedup download.


Usually curl can process such redirect automatically thanks to FOLLOW_LOCATION option, however due PHP limitations it can't do so, while either safe_mode or open_basedir options are set in php.ini.
Attached patch emulates FOLLOW_LOCATION behavior by following "Location:" header in received response, when curl isn't able to do it itself.
curl_and_follow_location_in_safe_mode.patch

Phil

unread,
May 17, 2012, 8:17:16 AM5/17/12
to in-port...@googlegroups.com
I've never used curl with inportal, but this is a nice improvement though !


Envoyé avec Sparrow

--
You received this message because you are subscribed to the Google Groups "In-Portal Bugs Team" group.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.

Pièces jointes :
- curl_and_follow_location_in_safe_mode.patch

Reply all
Reply to author
Forward
0 new messages