mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 02:50:02 -03:30
do not allow YAML strings that are OrderedDicts
This commit is contained in:
parent
3006e357f6
commit
60cbc3cbbc
@ -185,8 +185,9 @@ def vars_validate_or_raise(vars_str):
|
||||
except ValueError:
|
||||
pass
|
||||
try:
|
||||
yaml.safe_load(vars_str)
|
||||
return vars_str
|
||||
r = yaml.safe_load(vars_str)
|
||||
if not (isinstance(r, basestring) and r.startswith('OrderedDict(')):
|
||||
return vars_str
|
||||
except yaml.YAMLError:
|
||||
pass
|
||||
raise RestValidationError(_('Must be valid JSON or YAML.'))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user