Skip to content

Conversation

@knu
Copy link
Member

@knu knu commented Jun 7, 2021

I don't think there are use cases where an untrusted YAML jar should be loaded, but it is a good practice to be explicit about which classes are expected to be serialized in the YAML jar format.

Because CI for 1.8.7/REE was broken, I ran the test suite manually in my local environment with ruby 1.8.7.

This fixes #33.


if YAML.name == 'Psych' && Psych::VERSION >= '3.1'
def load_yaml(yaml)
YAML.safe_load(yaml, :permitted_classes => %w[Time HTTP::Cookie Mechanize::Cookie])
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

psych >=3.1 supports keyword arguments. We still support ruby 1.8.7, hence the rocket syntax.

{}
end

if YAML.name == 'Psych' && Psych::VERSION >= '3.1'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"3.10" > "3.1", in case you wonder.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am so very late here (thanks for doing this update btw), but in the distant future "10.0" < "3.1" :)

@knu
Copy link
Member Author

knu commented Jun 7, 2021

Just pushed v1.0.4.

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.

2 participants