disable osdn.jp URL

This commit is contained in:
Aaron Ruan 2024-05-26 16:51:44 +08:00
parent f1a7d971f2
commit 2fcbff8ee2
No known key found for this signature in database
GPG Key ID: EF612DB3936CDD62

View File

@ -328,7 +328,7 @@ module Cask
add_error "SourceForge URL format incorrect. See #{Formatter.url(SOURCEFORGE_OSDN_REFERENCE_URL)}", add_error "SourceForge URL format incorrect. See #{Formatter.url(SOURCEFORGE_OSDN_REFERENCE_URL)}",
location: cask.url.location location: cask.url.location
elsif bad_osdn_url? elsif bad_osdn_url?
add_error "OSDN URL format incorrect. See #{Formatter.url(SOURCEFORGE_OSDN_REFERENCE_URL)}", add_error "OSDN URLs are disabled.",
location: cask.url.location location: cask.url.location
end end
end end
@ -895,7 +895,7 @@ module Cask
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def bad_osdn_url? def bad_osdn_url?
bad_url_format?(/osd/, [%r{\Ahttps?://([^/]+.)?dl\.osdn\.jp/}]) cask.url.to_s.match?(/^(?:https?:\/\/)?(?:\w+\.)*osdn\.jp(?=\/|$)/)
end end
# sig { returns(String) } # sig { returns(String) }