From 6ebc2dcf5cc5b75f94e01e36cf95438802da5433 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 9 Dec 2013 12:43:48 +1100 Subject: [PATCH] never allow any js that takes longer than 5 seconds to run. --- lib/pretty_text.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pretty_text.rb b/lib/pretty_text.rb index 84503d6c62e..3a44e56d194 100644 --- a/lib/pretty_text.rb +++ b/lib/pretty_text.rb @@ -46,7 +46,8 @@ module PrettyText end def self.create_new_context - ctx = V8::Context.new + # timeout any eval that takes longer that 5 seconds + ctx = V8::Context.new(timeout: 5000) ctx["helpers"] = Helpers.new