From 2b679b1ef9164913f949c66fae6e27772410fea3 Mon Sep 17 00:00:00 2001 From: yanxd Date: Mon, 21 Apr 2014 20:00:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9C=8B=E5=9B=BE=E4=B8=8D=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 6edd2a8c8..66b9a282d 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -21,7 +21,7 @@ class AttachmentsController < ApplicationController before_filter :delete_authorize, :only => :destroy before_filter :authorize_global, :only => :upload - before_filter :require_login, only: [:download] + before_filter :login_without_softapplication, only: [:download] accept_api_auth :show, :download, :upload @@ -207,4 +207,9 @@ private end content_type.to_s end + + def login_without_softapplication + referer = request.headers["Referer"] + require_login unless referer =~ /softapplication/ + end end