From: Steve Coast Date: Mon, 21 Jan 2008 17:41:57 +0000 (+0000) Subject: emit last-modified headers on nodes and ways X-Git-Tag: live~8463 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/3e355d7dc0fff308170bb7c47dea7e8aa8e54acd emit last-modified headers on nodes and ways --- diff --git a/app/controllers/node_controller.rb b/app/controllers/node_controller.rb index d3f1ce7f6..1aef6a8a5 100644 --- a/app/controllers/node_controller.rb +++ b/app/controllers/node_controller.rb @@ -28,8 +28,8 @@ class NodeController < ApplicationController def read begin node = Node.find(params[:id]) - if node.visible + response.headers['Last-Modified'] = node.timestamp.rfc822 render :text => node.to_xml.to_s, :content_type => "text/xml" else render :text => "", :status => :gone diff --git a/app/controllers/way_controller.rb b/app/controllers/way_controller.rb index 413c65d1c..c1bbe5f72 100644 --- a/app/controllers/way_controller.rb +++ b/app/controllers/way_controller.rb @@ -32,6 +32,8 @@ class WayController < ApplicationController begin way = Way.find(params[:id]) + response.headers['Last-Modified'] = way.timestamp.rfc822 + if way.visible render :text => way.to_xml.to_s, :content_type => "text/xml" else