8000 Fix UnsupportedMediaType in samples (#323) · gorpo/botbuilder-python@bb0b7ef · GitHub
[go: up one dir, main page]

Skip to content

Commit bb0b7ef

Browse files
mdrichardsonaxelsrz
authored andcommitted
Fix UnsupportedMediaType in samples (microsoft#323)
1 parent 4e1a61b commit bb0b7ef

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

samples/06.using-cards/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ async def on_error(context: TurnContext, error: Exception):
5959
@APP.route("/api/messages", methods=["POST"])
6060
def messages():
6161
"""Main bot message handler."""
62-
if request.headers["Content-Type"] == "application/json":
62+
if "application/json" in request.headers["Content-Type"]:
6363
body = request.json
6464
else:
6565
return Response(status=415)

samples/13.core-bot/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
@APP.route("/api/messages", methods=["POST"])
4747
def messages():
4848
"""Main bot message handler."""
49-
if request.headers["Content-Type"] == "application/json":
49+
if "application/json" in request.headers["Content-Type"]:
5050
body = request.json
5151
else:
5252
return Response(status=415)

samples/21.corebot-app-insights/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ async def on_error(context: TurnContext, error: Exception):
6262
@APP.route("/api/messages", methods=["POST"])
6363
def messages():
6464
"""Main bot message handler."""
65-
if request.headers["Content-Type"] == "application/json":
65+
if "application/json" in request.headers["Content-Type"]:
6666
body = request.json
6767
else:
6868
return Response(status=415)

samples/45.state-management/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ async def on_error(context: TurnContext, error: Exception):
5757
@APP.route("/api/messages", methods=["POST"])
5858
def messages():
5959
"""Main bot message handler."""
60-
if request.headers["Content-Type"] == "application/json":
60+
if "application/json" in request.headers["Content-Type"]:
6161
body = request.json
6262
else:
6363
return Response(status=415)

samples/experimental/101.corebot-bert-bidaf/bot/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
@APP.route("/api/messages", methods=["POST"])
4040
def messages():
4141
"""Main bot message handler."""
42-
if request.headers["Content-Type"] == "application/json":
42+
if "application/json" in request.headers["Content-Type"]:
4343
body = request.json
4444
else:
4545
return Response(status=415)

samples/python_django/13.core-bot/bots/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def home():
2424

2525
def messages(request):
2626
"""Main bot message handler."""
27-
if request.headers["Content-Type"] == "application/json":
27+
if "application/json" in request.headers["Content-Type"]:
2828
body = json.loads(request.body.decode("utf-8"))
2929
else:
3030
return HttpResponse(status=415)

0 commit comments

Comments
 (0)
0