Project

General

Profile

« Previous | Next » 

Revision e657015b

Added by Nicolas CHARLES about 7 years ago

Fixes #10296: Accept TTL with spaces in relay API

View differences:

rudder-server-relay/SOURCES/relay-api/relay_api/shared_files.py
days = 0
seconds = int(m.group(1))
else:
daymatch = r'(\d+)d(?:ays?)?'
hourmatch = r'(\d+)h(?:ours?)?'
minmatch = r'(\d+)m(?:inutes?)?'
secmatch = r'(\d+)s(?:econds?)?'
match = r'^\s*(?:' + daymatch + r'\s*)?(?:' + hourmatch + r'\s*)?(?:' + minmatch + r'\s*)?(?:' + secmatch + r'\s*)?$'
daymatch = r'(\d+)\s*d(?:ays?)?'
hourmatch = r'(\d+)\s*h(?:ours?)?'
minmatch = r'(\d+)\s*m(?:inutes?)?'
secmatch = r'(\d+)\s*s(?:econds?)?'
match = r'^\s*(?:' + daymatch + r')?\s*(?:' + hourmatch + r')?\s*(?:' + minmatch + r')?\s*(?:' + secmatch + r')?\s*$'
m = re.match(match, string)
if m:
days = 0

Also available in: Unified diff