fix: escape curly braces in tap proxy f-string template
This commit is contained in:
parent
448a05856a
commit
c17a44f077
1 changed files with 1 additions and 1 deletions
|
|
@ -415,7 +415,7 @@ class Tap(http.server.BaseHTTPRequestHandler):
|
||||||
def do_PUT(self): self._tap('PUT')
|
def do_PUT(self): self._tap('PUT')
|
||||||
def _tap(self, method):
|
def _tap(self, method):
|
||||||
now = datetime.now().strftime('%H:%M:%S')
|
now = datetime.now().strftime('%H:%M:%S')
|
||||||
msg = f"\\n{'='*60}\\n[{now}] {method} {self.path}\\nClient: {self.client_address[0]}\\n"
|
msg = f"\\n{'='*60}\\n[{{now}}] {method} {self.path}\\nClient: {self.client_address[0]}\\n"
|
||||||
for k,v in sorted(self.headers.items()): msg += f" {k}: {v}\\n"
|
for k,v in sorted(self.headers.items()): msg += f" {k}: {v}\\n"
|
||||||
body = self.rfile.read(int(self.headers.get('Content-Length',0))) if 'Content-Length' in self.headers else None
|
body = self.rfile.read(int(self.headers.get('Content-Length',0))) if 'Content-Length' in self.headers else None
|
||||||
req = urllib.request.Request(f"{{BACKEND}}{{self.path}}", data=body, method=method)
|
req = urllib.request.Request(f"{{BACKEND}}{{self.path}}", data=body, method=method)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue