Rename `PremailerWebpackStrategy` -> `PremailerBundledAssetStrategy` (#29934)

main-rebase-security-fix
Matt Jankowski 2024-04-15 05:16:59 -04:00 committed by GitHub
parent bf5d948237
commit 0d9ad96d3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 5 deletions

View File

@ -97,7 +97,6 @@ Style/FetchEnvVar:
- 'config/initializers/paperclip.rb' - 'config/initializers/paperclip.rb'
- 'config/initializers/vapid.rb' - 'config/initializers/vapid.rb'
- 'lib/mastodon/redis_config.rb' - 'lib/mastodon/redis_config.rb'
- 'lib/premailer_webpack_strategy.rb'
- 'lib/tasks/repo.rake' - 'lib/tasks/repo.rake'
- 'spec/features/profile_spec.rb' - 'spec/features/profile_spec.rb'

View File

@ -1,9 +1,9 @@
# frozen_string_literal: true # frozen_string_literal: true
require_relative '../../lib/premailer_webpack_strategy' require_relative '../../lib/premailer_bundled_asset_strategy'
Premailer::Rails.config.merge!(remove_ids: true, Premailer::Rails.config.merge!(remove_ids: true,
adapter: :nokogiri, adapter: :nokogiri,
generate_text_part: false, generate_text_part: false,
css_to_attributes: false, css_to_attributes: false,
strategies: [PremailerWebpackStrategy]) strategies: [PremailerBundledAssetStrategy])

View File

@ -1,8 +1,8 @@
# frozen_string_literal: true # frozen_string_literal: true
module PremailerWebpackStrategy module PremailerBundledAssetStrategy
def load(url) def load(url)
asset_host = ENV['CDN_HOST'] || ENV['WEB_DOMAIN'] || ENV['LOCAL_DOMAIN'] asset_host = ENV['CDN_HOST'] || ENV['WEB_DOMAIN'] || ENV.fetch('LOCAL_DOMAIN', nil)
if Webpacker.dev_server.running? if Webpacker.dev_server.running?
asset_host = "#{Webpacker.dev_server.protocol}://#{Webpacker.dev_server.host_with_port}" asset_host = "#{Webpacker.dev_server.protocol}://#{Webpacker.dev_server.host_with_port}"