mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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,8 +10,8 @@ module Onebox
|
||||
requires_iframe_origins "https://www.youtube.com"
|
||||
always_https
|
||||
|
||||
WIDTH ||= 480
|
||||
HEIGHT ||= 360
|
||||
WIDTH = 480
|
||||
HEIGHT = 360
|
||||
|
||||
def parse_embed_response
|
||||
return unless video_id
|
||||
|
||||
@@ -7,7 +7,7 @@ module Onebox
|
||||
class DownloadTooLarge < StandardError
|
||||
end
|
||||
|
||||
IGNORE_CANONICAL_DOMAINS ||= %w[www.instagram.com medium.com youtube.com]
|
||||
IGNORE_CANONICAL_DOMAINS = %w[www.instagram.com medium.com youtube.com]
|
||||
|
||||
def self.clean(html)
|
||||
html.gsub(/<[^>]+>/, " ").gsub(/\n/, "")
|
||||
|
||||
@@ -5,7 +5,7 @@ module Onebox
|
||||
# see https://bugs.ruby-lang.org/issues/14688
|
||||
client_exception =
|
||||
defined?(Net::HTTPClientException) ? Net::HTTPClientException : Net::HTTPServerException
|
||||
WEB_EXCEPTIONS ||= [
|
||||
WEB_EXCEPTIONS = [
|
||||
client_exception,
|
||||
OpenURI::HTTPError,
|
||||
Timeout::Error,
|
||||
|
||||
@@ -107,7 +107,7 @@ module Onebox
|
||||
),
|
||||
)
|
||||
|
||||
DISCOURSE_ONEBOX ||=
|
||||
DISCOURSE_ONEBOX =
|
||||
Sanitize::Config.freeze_config(
|
||||
Sanitize::Config.merge(
|
||||
ONEBOX,
|
||||
|
||||
Reference in New Issue
Block a user