fix elapsed to always use floating point notation

This commit is contained in:
ducklet 2021-07-07 22:58:52 +02:00
parent 2c30a67e83
commit a39a0e6442

View file

@ -20,7 +20,7 @@ class ResponseTimeMiddleware:
if message["type"] == "http.response.start":
headers = MutableHeaders(scope=message)
elapsed = perf_counter() - start
headers.append(self.header_name, str(elapsed))
headers.append(self.header_name, f"{elapsed:.20f}")
await send(message)
await self.app(scope, receive, send_wrapper)