Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added option in .env for allow_eval to be activated in jsonPath

  • Loading branch information...
commit f8f5128e2df810a321308bd3a654cc4edb716d18 1 parent 9fa907b
snicker authored
Showing with 6 additions and 1 deletion.
  1. +5 −0 .env.example
  2. +1 −1  lib/utils.rb
5 .env.example
View
@@ -76,3 +76,8 @@ AWS_ACCESS_KEY="your aws access key"
# Set AWS_SANDBOX to true if you're developing Huginn code.
AWS_SANDBOX=false
+
+########################
+# Various Settings #
+########################
+ALLOW_EVAL=false
2  lib/utils.rb
View
@@ -52,7 +52,7 @@ def self.values_at(data, path)
escape = false
end
- result = JsonPath.new(path, :allow_eval => false).on(data.is_a?(String) ? data : data.to_json)
+ result = JsonPath.new(path, :allow_eval => ENV['ALLOW_EVAL'] == "true" || false).on(data.is_a?(String) ? data : data.to_json)
if escape
result.map {|r| CGI::escape r }
else
Please sign in to comment.
Something went wrong with that request. Please try again.