Return path from _path_data() (rest_api.py)

This commit is contained in:
jesopo 2019-02-08 21:56:58 +00:00
parent e84f91977c
commit 4a68baa0a6

View file

@ -15,7 +15,7 @@ class Handler(http.server.BaseHTTPRequestHandler):
_, _, endpoint = path[1:].partition("/")
endpoint, _, args = endpoint.partition("/")
args = list(filter(None, args.split("/")))
return endpoint, args
return path, endpoint, args
def _url_params(self):
parsed = urllib.parse.urlparse(self.path)
@ -27,7 +27,7 @@ class Handler(http.server.BaseHTTPRequestHandler):
return self.rfile.read(content_length)
def _handle(self, method):
endpoint, args = self._path_data()
path, endpoint, args = self._path_data()
headers = utils.CaseInsensitiveDict(dict(self.headers.items()))
params = self._url_params()
data = self._body()