1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2025-07-01 22:35:45 +00:00

chore(ci): ♻️ convert Python old % string to f-strings

This commit is contained in:
Kevin Marilleau
2021-03-19 12:12:24 +01:00
committed by Nicolas Duchon
parent eba9ac4261
commit 37e85e6e8d
8 changed files with 45 additions and 46 deletions

View File

@ -13,13 +13,13 @@ class Handler(http.server.SimpleHTTPRequestHandler):
if self.path == "/headers":
response_body += self.headers.as_string()
elif self.path == "/port":
response_body += "answer from port %s\n" % PORT
response_body += f"answer from port {PORT}\n"
elif re.match("/status/(\d+)", self.path):
result = re.match("/status/(\d+)", self.path)
response_code = int(result.group(1))
response_body += "answer with response code %s\n" % response_code
response_body += f"answer with response code {response_code}\n"
elif self.path == "/":
response_body += "I'm %s\n" % os.environ['HOSTNAME']
response_body += f"I'm {os.environ['HOSTNAME']}\n"
else:
response_body += "No route for this path!\n"
response_code = 404