--[[ <HCExtension>@name ImgBlock@event RequestHeaderReceived/Request@event AnswerHeaderReceived/Answer</HCExtension> ]]function GetContentType(s) _,_,x = string.find(s, '[cC]ontent%-[tT]ype: *([^;\r\n]+)') if x~=nil then x = string.lower(x) end return xendfunction Request() if re.find(hc.url, [[^[^?]+\.(ani|bmp|cur|gif|ico|i[mp]g|jpe?g|png|svgz?|swf|tiff?|wmf)(\?|$)]], 0) then hc.action = 'stop' hc.monitor_string = hc.monitor_string..'ImgBlock ' endendfunction Answer() -- Только для GET-запросов if hc.method == 'GET' then -- забираем тип файла из заголовка 'Content-Type' type = GetContentType(hc.answer_header) -- есть ли в поле заголовка 'Content-Type' слово 'image' if type~=nil then img = string.find(type,'image',1,true) else img = nil end if img~=nil then hc.action = 'stop' hc.monitor_string = hc.monitor_string..'ImgBlock ' end endend