Add Last-Modified date to document items in listings
Not in RS spec draft yet, see https://github.com/remotestorage/spec/issues/158 for discussion.
This commit is contained in:
@@ -126,13 +126,20 @@ module RemoteStorage
|
||||
if string.sub(name, -1) ~= "/" then
|
||||
listing[name]["Content-Type"] = metadata["t"]
|
||||
listing[name]["Content-Length"] = tonumber(metadata["s"])
|
||||
listing[name]["Last-Modified"] = tonumber(metadata["m"])
|
||||
end
|
||||
end
|
||||
|
||||
return cjson.encode(listing)
|
||||
EOF
|
||||
|
||||
JSON.parse(redis.eval(lua_script, nil, [user, directory]))
|
||||
items = JSON.parse(redis.eval(lua_script, nil, [user, directory]))
|
||||
|
||||
items.reject{|k, _| k.end_with? "/"}.each do |_, v|
|
||||
v["Last-Modified"] = Time.at(v["Last-Modified"]/1000).httpdate
|
||||
end
|
||||
|
||||
items
|
||||
end
|
||||
|
||||
def put_data(user, directory, key, data, content_type)
|
||||
|
||||
Reference in New Issue
Block a user