From: Naoki Kambe Date: Tue, 6 Nov 2012 12:40:11 +0000 (+0900) Subject: [2298_7] add comments about preparation of the requested path, X-Git-Tag: trac2487_base~1^2~26^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e849dc00862135e87b39dfc458ce6779a0b2945;p=thirdparty%2Fkea.git [2298_7] add comments about preparation of the requested path, regarding the condition that it is started with XM_URL_PATH + '/' --- diff --git a/src/bin/stats/stats_httpd.py.in b/src/bin/stats/stats_httpd.py.in index a650c452f0..4796abfcd2 100644 --- a/src/bin/stats/stats_httpd.py.in +++ b/src/bin/stats/stats_httpd.py.in @@ -126,11 +126,16 @@ class HttpHandler(http.server.BaseHTTPRequestHandler): # e.g. /bind10/statistics/Auth/, is started with # XML_URL_PATH + '/' if req_path.find('%s/' % XML_URL_PATH) == 0: + # remove './' from the path if there is req_path = os.path.normpath(req_path) + # get the strings tailing after XML_URL_PATH req_path = req_path.lstrip('%s/' % XML_URL_PATH) + # remove empty dir names from the path if there are path_dirs = req_path.split('/') path_dirs = [ d for d in filter(None, path_dirs) ] req_path = '/'.join(path_dirs) + # pass the complete requested path, + # e.g. Auth/queries.upd, to xml_handler() body = self.server.xml_handler(req_path) # In case that the requested path (req_path) is exactly # matched with XSD_URL_PATH