mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 17:52:39 +02:00
Merge branch 'master' of github.com:neocities/neocities
This commit is contained in:
commit
f5ae443ad5
1 changed files with 11 additions and 1 deletions
12
app/blog.rb
12
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
|
Loading…
Add table
Reference in a new issue