DEV: Compatibility with Ruby 3.2 (#19303)

This commit is contained in:
Rafael dos Santos Silva
2022-12-13 16:03:53 -03:00
committed by GitHub
parent f58eaf529f
commit 0434de6cee
6 changed files with 26 additions and 18 deletions

View File

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