diff options
author | Francisco Javier López <fjlopez@gitlab.com> | 2018-08-30 12:34:41 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-08-30 12:34:41 +0000 |
commit | edb5759caf8c328803fdc04e3ae520d234edfcfc (patch) | |
tree | e73ba9b241027664a1e27d5778cbd18c0e5a9434 /app/controllers/projects/avatars_controller.rb | |
parent | b8856d662942f54d7353e69505be08deb9b1d575 (diff) | |
download | gitlab-ce-edb5759caf8c328803fdc04e3ae520d234edfcfc.tar.gz |
Fixed project logo when it is LFS tracked
Diffstat (limited to 'app/controllers/projects/avatars_controller.rb')
-rw-r--r-- | app/controllers/projects/avatars_controller.rb | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/app/controllers/projects/avatars_controller.rb b/app/controllers/projects/avatars_controller.rb index 53fdc5843b5..878c82cd183 100644 --- a/app/controllers/projects/avatars_controller.rb +++ b/app/controllers/projects/avatars_controller.rb @@ -1,24 +1,16 @@ class Projects::AvatarsController < Projects::ApplicationController - include BlobHelper + include SendsBlob before_action :authorize_admin_project!, only: [:destroy] def show @blob = @repository.blob_at_branch(@repository.root_ref, @project.avatar_in_git) - if @blob - headers['X-Content-Type-Options'] = 'nosniff' - return if cached_blob? - - send_git_blob @repository, @blob - else - render_404 - end + send_blob(@blob) end def destroy @project.remove_avatar! - @project.save redirect_to edit_project_path(@project, anchor: 'js-general-project-settings'), status: :found |