Skip to content

Commit

Permalink
Merge pull request #11 from bolshakov/feature/safe-loading
Browse files Browse the repository at this point in the history
Load YAML safely
  • Loading branch information
bolshakov authored Oct 21, 2024
2 parents 842e266 + 0016d32 commit 49ac4dd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/config_x/config_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def setting_files
# @return [Array] the local setting files.
def local_setting_files
[
(File.join(config_root, "#{file_name}.local.yml") if env != "test"),
File.join(config_root, "#{file_name}.local.yml"),
File.join(config_root, dir_name, "#{env}.local.yml")
].compact
end
Expand Down
2 changes: 1 addition & 1 deletion lib/config_x/env_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def source

Array(key.split(separator)[1..])
.reverse_each
.reduce(YAML.load(value)) { |acc, k| {k.downcase => acc} }
.reduce(YAML.safe_load(value)) { |acc, k| {k.downcase => acc} }
.tap { DeepMerge.deep_merge!(_1, config) }
end
end
Expand Down

0 comments on commit 49ac4dd

Please sign in to comment.