From 0be6ebcd4bfda88eaab4fe899a1216d4038cc79c Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Tue, 4 Jul 2017 07:27:44 +0200 Subject: [PATCH] tools/web: fill a default Content-Type in case of POST --- nemubot/tools/web.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nemubot/tools/web.py b/nemubot/tools/web.py index fc37391..0852664 100644 --- a/nemubot/tools/web.py +++ b/nemubot/tools/web.py @@ -108,6 +108,9 @@ def getURLContent(url, body=None, timeout=7, header=None): elif "User-agent" not in header: header["User-agent"] = "Nemubot v%s" % __version__ + if body is not None and "Content-Type" not in header: + header["Content-Type"] = "application/x-www-form-urlencoded" + import socket try: if o.query != '':