tools/web: fill a default Content-Type in case of POST
This commit is contained in:
parent
b27e01a196
commit
aeba947877
@ -108,6 +108,9 @@ def getURLContent(url, body=None, timeout=7, header=None):
|
|||||||
elif "User-agent" not in header:
|
elif "User-agent" not in header:
|
||||||
header["User-agent"] = "Nemubot v%s" % __version__
|
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
|
import socket
|
||||||
try:
|
try:
|
||||||
if o.query != '':
|
if o.query != '':
|
||||||
|
Loading…
Reference in New Issue
Block a user