From: Tom Hughes Date: Tue, 21 Apr 2009 17:10:35 +0000 (+0000) Subject: Add an expiry header to trace images. X-Git-Tag: live~7531 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/ddba8eeff7c828840c128ed70e414c55983a8404?ds=sidebyside Add an expiry header to trace images. --- diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index dc7456c45..cabbb4ff9 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -233,6 +233,7 @@ class TraceController < ApplicationController if trace.inserted? if trace.public? or (@user and @user == trace.user) + expires_in 7.days, :private => !trace.public, :public => trace.public send_file(trace.large_picture_name, :filename => "#{trace.id}.gif", :type => 'image/gif', :disposition => 'inline') else render :nothing => true, :status => :forbidden @@ -249,6 +250,7 @@ class TraceController < ApplicationController if trace.inserted? if trace.public? or (@user and @user == trace.user) + expires_in 7.days, :private => !trace.public, :public => trace.public send_file(trace.icon_picture_name, :filename => "#{trace.id}_icon.gif", :type => 'image/gif', :disposition => 'inline') else render :nothing => true, :status => :forbidden