diff --git a/app/blog.rb b/app/blog.rb index 606622a3..3d593485 100644 --- a/app/blog.rb +++ b/app/blog.rb @@ -8,5 +8,15 @@ end get '/blog/:article' do |article| expires 500, :public, :must_revalidate - return Net::HTTP.get_response(URI("http://blog.neocities.org/#{article}.html")).body + + attempted = false + + begin + return Net::HTTP.get_response(URI("http://blog.neocities.org/#{article}.html")).body + rescue => e + raise e if attempted + attempted = true + article = article.match(/^[a-zA-Z0-9-]+/).to_s + retry + end end \ No newline at end of file