diff --git a/lib/remote_storage/riak.rb b/lib/remote_storage/riak.rb index 0804b60..16edd80 100644 --- a/lib/remote_storage/riak.rb +++ b/lib/remote_storage/riak.rb @@ -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"] diff --git a/spec/directories_spec.rb b/spec/directories_spec.rb index 9a7f191..36670f7 100644 --- a/spec/directories_spec.rb +++ b/spec/directories_spec.rb @@ -26,16 +26,6 @@ describe "Directories" do last_response.body.must_equal "" end - it "has a Last-Modifier header set" do - last_response.status.must_equal 200 - last_response.headers["Last-Modified"].wont_be_nil - - now = Time.now - last_modified = DateTime.parse(last_response.headers["Last-Modified"]) - last_modified.year.must_equal now.year - last_modified.day.must_equal now.day - end - it "has an ETag header set" do last_response.status.must_equal 200 last_response.headers["ETag"].wont_be_nil @@ -85,18 +75,6 @@ describe "Directories" do content["items"]["foo"]["Content-Length"].must_equal 14 end - it "has a Last-Modifier header set" do - get "/jimmy/tasks/" - - last_response.status.must_equal 200 - last_response.headers["Last-Modified"].wont_be_nil - - now = Time.now - last_modified = DateTime.parse(last_response.headers["Last-Modified"]) - last_modified.year.must_equal now.year - last_modified.day.must_equal now.day - end - it "has an ETag header set" do get "/jimmy/tasks/" diff --git a/spec/permissions_spec.rb b/spec/permissions_spec.rb index ccf89c8..6652c85 100644 --- a/spec/permissions_spec.rb +++ b/spec/permissions_spec.rb @@ -26,8 +26,6 @@ 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 it "returns the value from a sub-directory" do diff --git a/spec/riak_spec.rb b/spec/riak_spec.rb index b9db15c..035383e 100644 --- a/spec/riak_spec.rb +++ b/spec/riak_spec.rb @@ -22,16 +22,6 @@ describe "App with Riak backend" do last_response.body.must_equal "" end - it "has a Last-Modified header set" do - last_response.status.must_equal 200 - last_response.headers["Last-Modified"].wont_be_nil - - now = Time.now - last_modified = DateTime.parse(last_response.headers["Last-Modified"]) - last_modified.year.must_equal now.year - last_modified.day.must_equal now.day - end - it "has an ETag header set" do last_response.status.must_equal 200 last_response.headers["ETag"].wont_be_nil @@ -58,17 +48,6 @@ describe "App with Riak backend" do last_response.body.must_equal "some text data" end - # If this one fails, try restarting Riak - it "has a Last-Modified header set" do - last_response.status.must_equal 200 - last_response.headers["Last-Modified"].wont_be_nil - - now = Time.now - last_modified = DateTime.parse(last_response.headers["Last-Modified"]) - last_modified.year.must_equal now.year - last_modified.day.must_equal now.day - end - it "has an ETag header set" do last_response.status.must_equal 200 last_response.headers["ETag"].wont_be_nil