Merge branch 'master' of github.com:neocities/neocities

This commit is contained in:
Victoria Wang 2015-12-09 13:39:51 -08:00
commit 4bab84cf9d
2 changed files with 9 additions and 1 deletions

View file

@ -117,7 +117,7 @@ class Site < Sequel::Model
custom_ssl_certificates: false, custom_ssl_certificates: false,
no_file_restrictions: false, no_file_restrictions: false,
custom_domains: false, custom_domains: false,
maximum_site_files: 1000 maximum_site_files: 2000
) )
def self.newsletter_sites def self.newsletter_sites

View file

@ -18,11 +18,19 @@ class PurgeCacheWorker
"http://#{proxy_ip}#{path}", "http://#{proxy_ip}#{path}",
Addressable::URI::CharacterClasses::QUERY Addressable::URI::CharacterClasses::QUERY
) )
retry_encoded = false
begin begin
RestClient::Request.execute method: :head, url: url, timeout: HTTP_TIMEOUT, headers: { RestClient::Request.execute method: :head, url: url, timeout: HTTP_TIMEOUT, headers: {
host: URI::encode("#{username}.neocities.org"), host: URI::encode("#{username}.neocities.org"),
cache_purge: '1' cache_purge: '1'
} }
rescue URI::InvalidURIError
raise if retry_encoded == true
url = URI.encode url
retry_encoded = true
retry
rescue RestClient::ResourceNotFound rescue RestClient::ResourceNotFound
rescue RestClient::Forbidden rescue RestClient::Forbidden
end end