Merge commit 'f378f10404' into kb_migration

This commit is contained in:
KMY 2023-06-07 11:45:52 +09:00
commit edb2a5dcf3
153 changed files with 1225 additions and 1025 deletions

View file

@ -119,7 +119,7 @@ class DomainBlock < ApplicationRecord
def rule_for(domain)
return if domain.blank?
uri = Addressable::URI.new.tap { |u| u.host = domain.strip.gsub(/[\/]/, '') }
uri = Addressable::URI.new.tap { |u| u.host = domain.strip.delete('/') }
segments = uri.normalized_host.split('.')
variants = segments.map.with_index { |_, i| segments[i..-1].join('.') }