diff options
author | tony <tony> | 2009-03-12 08:56:37 +0000 |
---|---|---|
committer | tony <tony> | 2009-03-12 08:56:37 +0000 |
commit | 37fa2c4b27fb24a97596cdc6ccd904ce3c6d59c5 (patch) | |
tree | 851ac9e0a7db544108bf558f1209a44416173460 /app/controllers/track_controller.rb | |
parent | 6fc7bf684607cf998302140b98c721afa8e346e2 (diff) |
Issue permanent redirects for old-style atom feed requests
Diffstat (limited to 'app/controllers/track_controller.rb')
-rw-r--r-- | app/controllers/track_controller.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb index ec90b966b..7668bde7c 100644 --- a/app/controllers/track_controller.rb +++ b/app/controllers/track_controller.rb @@ -5,7 +5,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: track_controller.rb,v 1.29 2009-03-05 19:30:52 francis Exp $ +# $Id: track_controller.rb,v 1.30 2009-03-12 08:56:37 tony Exp $ class TrackController < ApplicationController @@ -101,14 +101,19 @@ class TrackController < ApplicationController return true end - # Atom feed (like RSS) for the track + # Old-Style atom track. We're phasing this out, so for now issue a + # 301 Redirect. Most aggregators should honour this, but we should + # keep an eye on the logs to see which ones are still used before + # deleting this (or for safety, we may wish to move them to a new + # table) def atom_feed @track_thing = TrackThing.find(params[:track_id].to_i) if @track_thing.track_medium != 'feed' raise "can only view feeds for feed tracks, not email ones" end - atom_feed_internal + redirect_to do_track_url(@track_thing, 'feed'), :status=>:moved_permanently end + def atom_feed_internal @xapian_object = perform_search([InfoRequestEvent], @track_thing.track_query, @track_thing.params[:feed_sortby], nil, 25, 1) respond_to do |format| |