Skip to content

Commit

Permalink
Fix KeyError if no Content-Type was provided in request.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fiete Gruenter committed Aug 2, 2017
1 parent d51e9c8 commit 26031bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion connexion/decorators/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def wrapper(request):
return problem(415,
"Unsupported Media Type",
"Invalid Content-type ({content_type}), expected JSON data".format(
content_type=request.headers["Content-Type"]
content_type=request.headers.get("Content-Type", "")
))

logger.debug("%s validating schema...", request.url)
Expand Down

0 comments on commit 26031bc

Please sign in to comment.