mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 05:03:39 +08:00
86e6732f78
always allow /srv/status through even if host does not match
20 lines
422 B
Ruby
20 lines
422 B
Ruby
# frozen_string_literal: true
|
|
|
|
class RailsMultisite::DiscoursePatches
|
|
def self.config
|
|
{
|
|
db_lookup: lambda do |env|
|
|
env["PATH_INFO"] == "/srv/status" ? "default" : nil
|
|
end
|
|
}
|
|
end
|
|
end
|
|
|
|
if Rails.configuration.multisite
|
|
Rails.configuration.middleware.swap(
|
|
RailsMultisite::ConnectionManagement,
|
|
RailsMultisite::ConnectionManagement,
|
|
RailsMultisite::DiscoursePatches.config
|
|
)
|
|
end
|