redmine#20277.patch

Olivier Houdas, 2016-12-05 10:20

Download (1.37 KB)

View differences:

app/controllers/attachments_controller.rb Mon Dec 05 10:21:04 2016 +0100
59 59
      @attachment.increment_download
60 60
    end
61 61

  
62
    if stale?(:etag => @attachment.digest)
62
    if stale?(:etag => @attachment.digest, :template => false)
63 63
      # images are sent inline
64 64
      send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename),
65 65
                                      :type => detect_content_type(@attachment),
......
69 69

  
70 70
  def thumbnail
71 71
    if @attachment.thumbnailable? && tbnail = @attachment.thumbnail(:size => params[:size])
72
      if stale?(:etag => tbnail)
72
      if stale?(:etag => tbnail, :template => false)
73 73
        send_file tbnail,
74 74
          :filename => filename_for_content_disposition(@attachment.filename),
75 75
          :type => detect_content_type(@attachment),