mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
BUGFIX: proper multisite support for origin pull CDNs
This commit is contained in:
@ -20,8 +20,16 @@ class UserAvatarsController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def show
|
||||
# we need multisite support to keep a single origin pull for CDNs
|
||||
RailsMultisite::ConnectionManagement.with_hostname(params[:hostname]) do
|
||||
show_in_site
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def show_in_site
|
||||
username = params[:username].to_s
|
||||
return render_dot unless user = User.find_by(username_lower: username.downcase)
|
||||
|
||||
@ -62,7 +70,6 @@ class UserAvatarsController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
# this protects us from a DoS
|
||||
def render_dot
|
||||
|
Reference in New Issue
Block a user