Use last_modified method instead of setting the header manually
authorTom Hughes <tom@compton.nu>
Thu, 9 Sep 2010 23:12:35 +0000 (00:12 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 14 Nov 2011 09:42:44 +0000 (09:42 +0000)
app/controllers/node_controller.rb
app/controllers/old_node_controller.rb
app/controllers/old_relation_controller.rb
app/controllers/old_way_controller.rb
app/controllers/relation_controller.rb
app/controllers/way_controller.rb

index 33e0ed3ee876f358c77c3e93dada13bd753ae716..19eb771638a53963b73531903326fd8c45faf936 100644 (file)
@@ -26,7 +26,7 @@ class NodeController < ApplicationController
   def read
     node = Node.find(params[:id])
     if node.visible?
-      response.headers['Last-Modified'] = node.timestamp.rfc822
+      response.last_modified = node.timestamp
       render :text => node.to_xml.to_s, :content_type => "text/xml"
     else
       render :text => "", :status => :gone
index ea443216c50e63ecdc05327f73d1e5485adc04f8..514e5befe9198a15d1709ab020ffb9325144613e 100644 (file)
@@ -19,7 +19,7 @@ class OldNodeController < ApplicationController
   
   def version
     if old_node = OldNode.where(:id => params[:id], :version => params[:version]).first
-      response.headers['Last-Modified'] = old_node.timestamp.rfc822
+      response.last_modified = old_node.timestamp
 
       doc = OSM::API.new.get_xml_doc
       doc.root << old_node.to_xml_node
index 3f4b884f6ff88c59211b0f31278535903017cc98..0e1950ceee6b2c83d54bcee2677e5b3c02abc42d 100644 (file)
@@ -18,7 +18,7 @@ class OldRelationController < ApplicationController
   
   def version
     if old_relation = OldRelation.where(:id => params[:id], :version => params[:version]).first
-      response.headers['Last-Modified'] = old_relation.timestamp.rfc822
+      response.last_modified = old_relation.timestamp
 
       doc = OSM::API.new.get_xml_doc
       doc.root << old_relation.to_xml_node
index ac1c6cd40805056ae377fefd9517ec960e55c603..5ea1a0497d7cba35a85fe8a0c03eb3de6fc6cf41 100644 (file)
@@ -19,7 +19,7 @@ class OldWayController < ApplicationController
   
   def version
     if old_way = OldWay.where(:id => params[:id], :version => params[:version]).first
-      response.headers['Last-Modified'] = old_way.timestamp.rfc822
+      response.last_modified = old_way.timestamp
 
       doc = OSM::API.new.get_xml_doc
       doc.root << old_way.to_xml_node
index db68847e54a274819d2d5dc9e0c8ab8e99d72e71..0c2cccd11ee847cf46ff8af315bb6c1e9b316301 100644 (file)
@@ -26,7 +26,7 @@ class RelationController < ApplicationController
 
   def read
     relation = Relation.find(params[:id])
-    response.headers['Last-Modified'] = relation.timestamp.rfc822
+    response.last_modified = relation.timestamp
     if relation.visible
       render :text => relation.to_xml.to_s, :content_type => "text/xml"
     else
index f19d6db7d1d271884e8da2a7e46710c783c435fe..e20eb1a7970c2942176d4302ecd987fc0b652ff1 100644 (file)
@@ -25,7 +25,7 @@ class WayController < ApplicationController
   def read
     way = Way.find(params[:id])
     
-    response.headers['Last-Modified'] = way.timestamp.rfc822
+    response.last_modified = way.timestamp
     
     if way.visible
       render :text => way.to_xml.to_s, :content_type => "text/xml"