Last-Modified header is not needed anymore

This commit is contained in:
Garret Alfert
2014-01-09 21:00:13 +01:00
parent 8073eec851
commit 38e69f1423
4 changed files with 0 additions and 57 deletions

View File

@@ -163,16 +163,12 @@ module RemoteStorage
def set_object_response_headers(object)
server.headers["Content-Type"] = object.content_type
server.headers["Last-Modified"] = last_modified_date_for(object)
server.headers["ETag"] = object.etag
server.headers["Content-Length"] = object_size(object)
end
def set_directory_response_headers(directory_object)
timestamp = directory_object.data.to_i
timestamp /= 1000 if timestamp.to_s.length == 13
server.headers["Content-Type"] = "application/json"
server.headers["Last-Modified"] = Time.at(timestamp).to_s(:rfc822)
server.headers["ETag"] = directory_object.etag
end
@@ -234,14 +230,6 @@ module RemoteStorage
::Riak::Serializers[content_type[/^[^;\s]+/]]
end
def last_modified_date_for(object)
timestamp = object.meta["timestamp"]
timestamp = (timestamp[0].to_i / 1000) if timestamp
last_modified = timestamp ? Time.at(timestamp) : object.last_modified
last_modified.to_s(:rfc822)
end
def directory_permission(authorizations, directory)
authorizations = authorizations.map do |auth|
auth.index(":") ? auth.split(":") : [auth, "rw"]