mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 13:51:09 +08:00
DEV: Remove logical OR assignment of constants (#29201)
Constants should always be only assigned once. The logical OR assignment of a constant is a relic of the past before we used zeitwerk for autoloading and had bugs where a file could be loaded twice resulting in constant redefinition warnings.
This commit is contained in:

committed by
GitHub

parent
f3f37c9019
commit
322a3be2db
@ -10,7 +10,7 @@ class RobotsTxtController < ApplicationController
|
||||
OVERRIDDEN_HEADER = "# This robots.txt file has been customized at /admin/customize/robots\n"
|
||||
|
||||
# NOTE: order is important!
|
||||
DISALLOWED_PATHS ||= %w[
|
||||
DISALLOWED_PATHS = %w[
|
||||
/admin/
|
||||
/auth/
|
||||
/assets/browser-update*.js
|
||||
@ -21,7 +21,7 @@ class RobotsTxtController < ApplicationController
|
||||
/*?*api_key*
|
||||
]
|
||||
|
||||
DISALLOWED_WITH_HEADER_PATHS ||= %w[/badges /u/ /my /search /tag/*/l /g /t/*/*.rss /c/*.rss]
|
||||
DISALLOWED_WITH_HEADER_PATHS = %w[/badges /u/ /my /search /tag/*/l /g /t/*/*.rss /c/*.rss]
|
||||
|
||||
def index
|
||||
if (overridden = SiteSetting.overridden_robots_txt.dup).present?
|
||||
|
Reference in New Issue
Block a user