8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/quick_serve/rails/ext/mongrel.rb', line 8
def process(request, response)
return original_process(request, response) if request.params['REQUEST_METHOD'] != 'GET'
url = 'http://' + request.params["HTTP_HOST"] + request.params["REQUEST_URI"]
snapshot = QuickServe::Rails::Snapshot.fetch(url)
if snapshot
response.start do |head,out|
puts "quick_serve: served snapshot of #{url}"
head["Content-Type"] = "text/html"
out << snapshot
end
else
original_process(request, response)
end
end
|