mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
DEV: Compatibility with Ruby 3.2 (#19303)
This commit is contained in:

committed by
GitHub

parent
f58eaf529f
commit
0434de6cee
@ -48,7 +48,7 @@ class UserAvatarsController < ApplicationController
|
||||
|
||||
hijack do
|
||||
begin
|
||||
proxy_avatar("https://avatars.discourse-cdn.com/#{params[:version]}/letter/#{params[:letter]}/#{params[:color]}/#{params[:size]}.png", Time.new('1990-01-01'))
|
||||
proxy_avatar("https://avatars.discourse-cdn.com/#{params[:version]}/letter/#{params[:letter]}/#{params[:color]}/#{params[:size]}.png", Time.new(1990, 01, 01))
|
||||
rescue OpenURI::HTTPError
|
||||
render_blank
|
||||
end
|
||||
@ -190,7 +190,7 @@ class UserAvatarsController < ApplicationController
|
||||
def render_blank
|
||||
path = Rails.root + "public/images/avatar.png"
|
||||
expires_in 10.minutes, public: true
|
||||
response.headers["Last-Modified"] = Time.new('1990-01-01').httpdate
|
||||
response.headers["Last-Modified"] = Time.new(1990, 01, 01).httpdate
|
||||
response.headers["Content-Length"] = File.size(path).to_s
|
||||
send_file path, disposition: nil
|
||||
end
|
||||
|
Reference in New Issue
Block a user