Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 2 commits into
from
Jump to file or symbol
Failed to load files and symbols.
+6 −1
Split
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_JSONPATH_EVAL=false
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_JSONPATH_EVAL'] == "true" || false).on(data.is_a?(String) ? data : data.to_json)
if escape
result.map {|r| CGI::escape r }
else