From daad60ec731ed016b46ec26e33989bf66cc02d4d Mon Sep 17 00:00:00 2001 From: Jari Voutilainen Date: Tue, 15 Aug 2017 16:02:10 +0300 Subject: [PATCH] Check if the given string is url --- ckan/lib/helpers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ckan/lib/helpers.py b/ckan/lib/helpers.py index ecfa6baccb5..d171707cb69 100644 --- a/ckan/lib/helpers.py +++ b/ckan/lib/helpers.py @@ -173,7 +173,8 @@ def redirect_to(*args, **kw): _url = '' skip_url_parsing = False if uargs and len(uargs) is 1 and isinstance(uargs[0], basestring) \ - and uargs[0].startswith('/') and len(matching) is 0: + and (uargs[0].startswith('/') or is_url(uargs[0])) \ + and len(matching) is 0: skip_url_parsing = True _url = uargs[0]