1
0
mirror of https://github.com/apple/foundationdb.git synced 2025-05-25 00:30:00 +08:00

Make use of relpath instead of basepath

This commit is contained in:
Johannes M. Scheuermann 2022-05-07 09:26:00 +01:00
parent 4804bb21cf
commit b53c9fe851

@ -519,13 +519,13 @@ class Server(BaseHTTPRequestHandler):
if self.path.startswith("/check_hash/"): if self.path.startswith("/check_hash/"):
try: try:
self.send_text( self.send_text(
check_hash(os.path.basename(self.path)), add_newline=False check_hash(os.path.relpath(self.path, "/check_hash")), add_newline=False
) )
except FileNotFoundError: except FileNotFoundError:
self.send_error(404, "Path not found") self.send_error(404, "Path not found")
self.end_headers() self.end_headers()
if self.path.startswith("/is_present/"): if self.path.startswith("/is_present/"):
if is_present(os.path.basename(self.path)): if is_present(os.path.relpath(self.path, "/is_present")):
self.send_text("OK") self.send_text("OK")
else: else:
self.send_error(404, "Path not found") self.send_error(404, "Path not found")