From bdbaf0f8a779814217bfada2d840cf00b5ba7603 Mon Sep 17 00:00:00 2001 From: pictuga Date: Sat, 4 Apr 2020 16:21:37 +0200 Subject: [PATCH] morss/cgi: fix handling of special chars in url --- morss/morss.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/morss/morss.py b/morss/morss.py index 76ae759..51e37ec 100644 --- a/morss/morss.py +++ b/morss/morss.py @@ -25,13 +25,13 @@ try: # python 2 from Queue import Queue from httplib import HTTPException - from urllib import quote_plus + from urllib import unquote from urlparse import urlparse, urljoin, parse_qs except ImportError: # python 3 from queue import Queue from http.client import HTTPException - from urllib.parse import quote_plus + from urllib.parse import unquote from urllib.parse import urlparse, urljoin, parse_qs LIM_ITEM = 100 # deletes what's beyond @@ -523,7 +523,7 @@ def cgi_app(environ, start_response): if url.startswith(':'): split = url.split('/', 1) - raw_options = split[0].replace('|', '/').replace('\\\'', '\'').split(':')[1:] + raw_options = unquote(split[0]).replace('|', '/').replace('\\\'', '\'').split(':')[1:] if len(split) > 1: url = split[1]