Название: [Extension] Smart HTTP Referers Отправлено: www от 31 мая 2011, 06:03:31 I've created this simple Lua extension and hope that it'll be useful for someone else. Feel free to translate this "manual" to Russian or other languages, and please let me know if you find any errors or have any suggestions to improve the code. I'm not a programmer. :P
If a page requests a URL from another domain, Smart HTTP Referers modifies the referer to the new domain and adds the rule "SHR" to the monitor. If there's no referer or if the request comes from the same domain or a subdomain of the same domain, SHR doesn't do anything. I was inspired by Firefox's RefControl (https://addons.mozilla.org/en-US/firefox/addon/refcontrol/) and mai62's example extension (http://handycache.ru/component/option,com_smf/Itemid,10/topic,3156.msg26582/#msg26582), and tested it by opening some websites on Opera for Windows and Firefox for Linux (with HandyCache running on Wine). List of variables This list is just for reference.
Название: Re: [Extension] Smart HTTP Referers Отправлено: www от 06 июля 2011, 04:56:20 I've added mai62's example of a graphical options window (http://handycache.ru/component/option,com_smf/Itemid,10/topic,4012.0/) to STR, so users can add exceptions easily. The only website I've had problems with after a month using STR was Google, so I've included some of their domains by default to the exceptions list.
Название: Re: [Extension] Smart HTTP Referers Отправлено: www от 07 января 2012, 13:56:35 After updating HandyCache to the latest version, I've noticed that my extension is changing the referer to
Код: Referer: opera.com instead of just Код: Referer: opera.com Was it already broken or this was caused by the HandyCache update? :( Название: Re: [Extension] Smart HTTP Referers Отправлено: mai62 от 07 января 2012, 16:18:03 In last version the options used for regular expressions have changed.
Replace this line new_headers = re.replace(hc.request_header, "Referer:.*?http\:\/\/(.*?\/).*?\r\n", "Referer: http://"..get_host_full .. "\/\r\n") with another new_headers = re.replace(hc.request_header, "Referer:[^\r]*\r\n", "Referer: http://"..get_host_full) Название: Re: [Extension] Smart HTTP Referers Отправлено: www от 08 января 2012, 01:30:01 It seems that it worked. Thanks!
Powered by SMF 1.1.3 SMF © 2006, Simple Machines LLC
Joomla Bridge by JoomlaHacks.com |