FIX: letter avatars to live in uploads directory, add last modified

This commit is contained in:
Sam 2014-07-08 17:20:27 +10:00
parent aca0aa8e56
commit 9ee93aad5b
2 changed files with 2 additions and 1 deletions

View File

@ -29,6 +29,7 @@ class UserAvatarsController < ApplicationController
end end
image = LetterAvatar.generate(params[:username].to_s, params[:size].to_i) image = LetterAvatar.generate(params[:username].to_s, params[:size].to_i)
response.headers["Last-Modified"] = File.ctime(image).httpdate
expires_in 1.year, public: true expires_in 1.year, public: true
send_file image, disposition: nil send_file image, disposition: nil
end end

View File

@ -25,7 +25,7 @@ class LetterAvatar
def cache_path def cache_path
"tmp/letter_avatars/#{VERSION}" "public/uploads/letter_avatars/#{VERSION}"
end end
def generate(username, size, opts = nil) def generate(username, size, opts = nil)