From 1b1aae2348f0a47a94ccc310715237193f884f79 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 12 Apr 2015 12:01:11 +0300 Subject: [PATCH] fixed double slashes problem in remote motionEye cameras --- doc/requirements.txt | 9 --------- src/remote.py | 4 ++++ 2 files changed, 4 insertions(+), 9 deletions(-) delete mode 100644 doc/requirements.txt diff --git a/doc/requirements.txt b/doc/requirements.txt deleted file mode 100644 index 9a71525..0000000 --- a/doc/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -python>=2.6 -tornado -jinja2 -pil - -ffmpeg -motion -v4l-utils -cifs-utils diff --git a/src/remote.py b/src/remote.py index 92b91f6..6dc4feb 100644 --- a/src/remote.py +++ b/src/remote.py @@ -18,14 +18,18 @@ import functools import json import logging +import re from tornado.httpclient import AsyncHTTPClient, HTTPRequest import settings import utils +_DOUBLE_SLASH_REGEX = re.compile('//+') + def _make_request(host, port, username, password, uri, method='GET', data=None, query=None, timeout=None): + uri = _DOUBLE_SLASH_REGEX.sub('/', uri) url = '%(scheme)s://%(host)s%(port)s%(uri)s' % { 'scheme': 'http', 'host': host, -- 2.39.5