machinezone / cobra

Cobra is a realtime messaging server using Python3, WebSockets and Redis
BSD 3-Clause "New" or "Revised" License
32 stars 3 forks source link

Dummy position supplied by server doesn't pass validation #27

Closed abursavich closed 3 years ago

abursavich commented 3 years ago

Dummy position: 1519190184:559034812775

https://github.com/machinezone/cobra/blob/d9cb898f7c7092b93b426ab1e125592d9110b8d4/cobras/server/handlers/pubsub.py#L205

Position validation:

https://github.com/machinezone/rcc/blob/bbe0f517f30ca075cd021aac0252f489f730a444/rcc/subscriber.py#L19-L26

POSITION_PATTERN = re.compile('^(?P<id1>[0-9]+)-(?P<id2>[0-9]+)')

def validatePosition(position):
    if position is None or position == '$':
        return True
    return POSITION_PATTERN.match(position)
bsergean commented 3 years ago

Ah this one should be easy to fix, the dummy position needs its : to be replaced with a dash.