-- 14.19 / ETag
function mk_etag( stat )
if stat ~= nil then
- return string.format( "%x-%x-%x", stat.ino, stat.size, stat.mtime )
+ return string.format( '"%x-%x-%x"', stat.ino, stat.size, stat.mtime )
end
end
return true
end
- return false, 304
+ return false, 304, {
+ ["ETag"] = mk_etag( stat );
+ ["Last-Modified"] = date.to_http( stat.mtime )
+ }
end
return true
if req.request_method == "get" or
req.request_method == "head"
then
- h['ETag'] = mk_etag( stat )
- h['Last-Modified'] = date.to_http( stat.mtime )
-
- return false, 304
+ return false, 304, {
+ ["ETag"] = mk_etag( stat );
+ ["Last-Modified"] = date.to_http( stat.mtime )
+ }
else
return false, 412
end