このコミットが含まれているのは:
2026-07-12 01:47:34 +09:00
コミット 5bd097bcfe
6個のファイルの変更47行の追加16行の削除
+13
ファイルの表示
@@ -0,0 +1,13 @@
class PostUrlNormaliser
def self.normalise raw_url
value = raw_url.to_s.strip
uri = URI.parse(value)
return nil unless uri.is_a?(URI::HTTP) && uri.host.present?
uri.host = uri.host.downcase
uri.path = uri.path.sub(/\/\z/, '') if uri.path.present?
uri.to_s
rescue URI::InvalidURIError
nil
end
end