Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use YAML.unsafe_load to allow alias in configuration #1023

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

negipo
Copy link

@negipo negipo commented Dec 9, 2022

closes #1022
This PR suppress Psych::BadAlias error with configuration using aliases in Ruby 3.1.
YAML.unsafe_load is used because there can be no dangerous values in the configuration file.

@gblair
Copy link

gblair commented Feb 16, 2024

I'm not sure, but wouldn't it be more appropriate to use:

YAML.load(processed, aliases: true)[::Rails.env]

@negipo
Copy link
Author

negipo commented Feb 16, 2024

It seems yes, but YAML.unsafe_load would have better backward compatibility.
Rails got same solution in rails/rails#42257

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Psych::BadAlias in Ruby 3.1 configuration
2 participants