mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
BUGFIX: proper multisite support for origin pull CDNs
This commit is contained in:
parent
18bdc4e63e
commit
0c86d9ed9e
4 changed files with 35 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue