DEV: Switch letter avatar service to new domain (#10546)

This commit is contained in:
David Taylor 2020-08-27 12:05:36 +01:00 committed by GitHub
parent a51db9a7bf
commit 89cb537fae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ class UserAvatarsController < ApplicationController
hijack do
begin
proxy_avatar("https://avatars.discourse.org/#{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

View File

@ -12,7 +12,7 @@ describe UserAvatarsController do
end
it 'returns an avatar if we are allowing the proxy' do
stub_request(:get, "https://avatars.discourse.org/v3/letter/a/aaaaaa/360.png").to_return(body: 'image')
stub_request(:get, "https://avatars.discourse-cdn.com/v3/letter/a/aaaaaa/360.png").to_return(body: 'image')
get "/letter_avatar_proxy/v3/letter/a/aaaaaa/360.png"
expect(response.status).to eq(200)
end