mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-02-24 01:38:15 +00:00
Change to raw string literal
To fix: /webserver.py:17: SyntaxWarning: invalid escape sequence '\d' elif re.match("/status/(\d+)", self.path): /webserver.py:18: SyntaxWarning: invalid escape sequence '\d' result = re.match("/status/(\d+)", self.path)
This commit is contained in:
parent
1e55d9883f
commit
12d639dad7
@ -14,8 +14,8 @@ class Handler(http.server.SimpleHTTPRequestHandler):
|
|||||||
response_body += self.headers.as_string()
|
response_body += self.headers.as_string()
|
||||||
elif self.path == "/port":
|
elif self.path == "/port":
|
||||||
response_body += f"answer from port {PORT}\n"
|
response_body += f"answer from port {PORT}\n"
|
||||||
elif re.match("/status/(\d+)", self.path):
|
elif re.match(r"/status/(\d+)", self.path):
|
||||||
result = re.match("/status/(\d+)", self.path)
|
result = re.match(r"/status/(\d+)", self.path)
|
||||||
response_code = int(result.group(1))
|
response_code = int(result.group(1))
|
||||||
response_body += f"answer with response code {response_code}\n"
|
response_body += f"answer with response code {response_code}\n"
|
||||||
elif self.path == "/":
|
elif self.path == "/":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user