I’m following the example here to cache files but it seems there’s an issue with If-None-Match
. When having it and without request options, the server always return 400 bad request. I guess the If-None-Match
header is duplicated.
local function get_http_request_headers(name)
local data = load_http_response_headers(name)
local headers = {}
for k, v in pairs(data) do
if string.lower(k) == 'etag' then
headers['If-None-Match'] = v
elseif string.lower(k) == 'last-modified' then
headers['If-Modified-Since'] = v
end
end
return headers
end