This commit is contained in:
jmaa 2018-06-14 15:54:20 +02:00
commit ca62b059e6
2 changed files with 5 additions and 0 deletions

View File

@ -287,6 +287,7 @@ function internet.download_headers (url)
url = url,
method = 'HEAD'
}
print(_, code, headers, status)
--
return headers
end

View File

@ -544,6 +544,10 @@ local curb = require 'curb_your_enthusiasm'
local function is_image_link (str)
print(str)
if str:match '%.png$' or str:match '%.gif$' or str:match '%.jpg$' then
return true
end
--
if type(str) ~= 'string' then return false end
if not str:match '^%a+://.+$' then return false end
local headers = internet.download_headers(str)