mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Convert any backward slashes from path given by client
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
This commit is contained in:
parent
fe54935b29
commit
ff183fc053
1 changed files with 2 additions and 0 deletions
|
|
@ -2629,6 +2629,8 @@ def get_one_valid_targetinfo(self, target_filepath):
|
|||
# Raise 'securesystemslib.exceptions.FormatError' if there is a mismatch.
|
||||
securesystemslib.formats.RELPATH_SCHEMA.check_match(target_filepath)
|
||||
|
||||
target_filepath = target_filepath.replace('\\', '/')
|
||||
|
||||
if target_filepath.startswith('/'):
|
||||
raise tuf.exceptions.FormatError('The requested target file cannot'
|
||||
' contain a leading path separator: ' + repr(target_filepath))
|
||||
|
|
|
|||
Loading…
Reference in a new issue