proper content-disposition header when downloading attachments

This commit is contained in:
Régis Hanol
2013-09-06 19:18:42 +02:00
parent eae7e75611
commit 45b838009c
8 changed files with 94 additions and 42 deletions

View File

@ -24,7 +24,6 @@ class TopicsController < ApplicationController
skip_before_filter :check_xhr, only: [:show, :feed]
def show
# We'd like to migrate the wordpress feed to another url. This keeps up backwards compatibility with
# existing installs.
return wordpress if params[:best].present?
@ -33,7 +32,6 @@ class TopicsController < ApplicationController
begin
@topic_view = TopicView.new(params[:id] || params[:topic_id], current_user, opts)
rescue Discourse::NotFound
Rails.logger.info ">>>> B"
topic = Topic.where(slug: params[:id]).first if params[:id]
raise Discourse::NotFound unless topic
return redirect_to(topic.relative_url)