看图不登录

This commit is contained in:
yanxd 2014-04-21 20:00:50 +08:00
parent 87fdecdabd
commit 2b679b1ef9
1 changed files with 6 additions and 1 deletions

View File

@ -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