Set Last-Modified header

This commit is contained in:
galfert 2012-09-25 14:02:08 +02:00
parent 1cd01b8277
commit af28ec44c8
2 changed files with 3 additions and 0 deletions

View File

@ -30,6 +30,7 @@ module RemoteStorage
def get_data(user, category, key)
object = data_bucket.get("#{user}:#{category}:#{key}")
headers["Content-Type"] = object.content_type
headers["Last-Modified"] = object.last_modified.to_s(:rfc822)
case object.content_type
when "application/json"
return object.data.to_json

View File

@ -38,6 +38,8 @@ describe "Permissions" do
last_response.status.must_equal 200
last_response.body.must_equal "some text data"
last_response.headers["Last-Modified"].wont_be_nil
end
end
end