summaryrefslogtreecommitdiffstats
path: root/custodia/httpd/server.py
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2015-07-08 16:37:14 -0400
committerSimo Sorce <simo@redhat.com>2015-07-08 16:37:14 -0400
commit991e3295432e7e0abb86b6129c91e2d14381e124 (patch)
tree8fd3d83b5e8f5030d56a91e08b55e1299d99514b /custodia/httpd/server.py
parent5f85b79d56f338ef77ef7ff719a73815435fdf34 (diff)
downloadcustodia-991e3295432e7e0abb86b6129c91e2d14381e124.tar.gz
custodia-991e3295432e7e0abb86b6129c91e2d14381e124.tar.xz
custodia-991e3295432e7e0abb86b6129c91e2d14381e124.zip
Unquote the path before processing
This avoids issues where spaces get turned to %20 and then name matching comparisons (like for KEMHandler) fail. Signed-off-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'custodia/httpd/server.py')
-rw-r--r--custodia/httpd/server.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/custodia/httpd/server.py b/custodia/httpd/server.py
index 240e3b6..fd6ef0c 100644
--- a/custodia/httpd/server.py
+++ b/custodia/httpd/server.py
@@ -5,11 +5,12 @@ try:
from BaseHTTPServer import BaseHTTPRequestHandler
from SocketServer import ForkingMixIn, UnixStreamServer
from urlparse import urlparse, parse_qs
+ from urllib import unquote
except ImportError:
# pylint: disable=import-error,no-name-in-module
from http.server import BaseHTTPRequestHandler
from socketserver import ForkingMixIn, UnixStreamServer
- from urllib.parse import urlparse, parse_qs
+ from urllib.parse import urlparse, parse_qs, unquote
from custodia.log import stacktrace
from custodia.log import debug as log_debug
import os
@@ -127,7 +128,7 @@ class LocalHTTPRequestHandler(BaseHTTPRequestHandler):
url = urlparse(self.path)
# Yes, override path with the path part only
- self.path = url.path
+ self.path = unquote(url.path)
# Create dict out of query
self.query = parse_qs(url.query)