fix(api): 使用 ast.literal_eval 代替 eval,取消不正确的计算属性值返回。#688
Merged
pycook merged 2 commits intoveops:masterfrom Apr 4, 2025
Merged
fix(api): 使用 ast.literal_eval 代替 eval,取消不正确的计算属性值返回。#688pycook merged 2 commits intoveops:masterfrom
pycook merged 2 commits intoveops:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
原有的代码中,eval的本意可能是将jinja2返回的str变成合适的类型,但实际上会带来如下问题:
但本次修改也可能带来一定影响,主要是取消了eval兜底,原先配置的,不符合jinja2规范的代码没有办法继续生效了。