mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
SECURITY: Never crawl by IP
This commit is contained in:
@@ -68,14 +68,11 @@ class FinalDestination
|
||||
def validate_uri_format
|
||||
return false unless @uri
|
||||
return false unless ['https', 'http'].include?(@uri.scheme)
|
||||
return false if @uri.scheme == 'http' && @uri.port != 80
|
||||
return false if @uri.scheme == 'https' && @uri.port != 443
|
||||
|
||||
if @uri.scheme == 'http'
|
||||
return @uri.port == 80
|
||||
elsif @uri.scheme == 'https'
|
||||
return @uri.port == 443
|
||||
end
|
||||
|
||||
false
|
||||
# Disallow IP based crawling
|
||||
(IPAddr.new(@uri.hostname) rescue nil).nil?
|
||||
end
|
||||
|
||||
def is_public?
|
||||
|
||||
Reference in New Issue
Block a user