8000 Update aiohttp_telemetry_middleware.py (#1961) · dldinternet/botbuilder-python@7a03e65 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7a03e65

Browse files
Update aiohttp_telemetry_middleware.py (microsoft#1961)
Fix: content-type may not be present in some requests, e.g. /robots.txt request. Co-authored-by: tracyboehrer <tracyboehrer@users.noreply.github.com>
1 parent d6b5e67 commit 7a03e65

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/botbuilder-integration-applicationinsights-aiohttp/botbuilder/integration/applicationinsights/aiohttp/aiohttp_telemetry_middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def retrieve_aiohttp_body():
1919
@middleware
2020
async 5C26 def bot_telemetry_middleware(request, handler):
2121
"""Process the incoming Flask request."""
22-
if "application/json" in request.headers["Content-Type"]:
22+
if "Content-Type" in request.headers and request.headers["Content-Type"] == "application/json":
2323
body = await request.json()
2424
_REQUEST_BODIES[current_thread().ident] = body
2525

0 commit comments

Comments
 (0)
0