8000 Test correction for SM01307 (#2085) · Fertlas/botbuilder-python@8385410 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8385410

Browse files
tracyboehrerTracy Boehrer
andauthored
Test correction for SM01307 (microsoft#2085)
Co-authored-by: Tracy Boehrer <trboehre@microsoft.com>
1 parent 8f1b58d commit 8385410

File tree

1 file changed

+4
-3
lines changed
  • libraries/botbuilder-applicationinsights/django_tests

1 file changed

+4
-3
lines changed

libraries/botbuilder-applicationinsights/django_tests/views.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33

4+
import html
45
from rest_framework.decorators import api_view
56
from botbuilder.applicationinsights.django import common
67
from botbuilder.applicationinsights import ApplicationInsightsTelemetryClient
@@ -42,7 +43,7 @@ def errorer(request):
4243

4344

4445
def echoer(request):
45-
return HttpResponse(request.appinsights.request.id)
46+
return HttpResponse(html.escape(request.appinsights.request.id))
4647

4748

4849
@api_view(["POST"])
@@ -52,12 +53,12 @@ def getid(request, id):
5253

5354
@api_view(["POST"])
5455
def returncode(request, id):
55-
return HttpResponse("returncode", status=int(id))
56+
return HttpResponse("returncode", status=int(html.escape(id)))
5657

5758

5859
@api_view(["POST"])
5960
def templater(request, data):
60-
return TemplateResponse(request, "template.html", {"context": data})
61+
return TemplateResponse(request, "template.html", {"context": html.escape(data)})
6162

6263

6364
class classview:

0 commit comments

Comments
 (0)
0