fix request.json, close #1337
This commit is contained in:
@@ -48,7 +48,7 @@ _HISTORY_KIND = '_Shell_History'
|
|||||||
UNPICKLABLE_TYPES = [
|
UNPICKLABLE_TYPES = [
|
||||||
types.ModuleType,
|
types.ModuleType,
|
||||||
type,
|
type,
|
||||||
ClassType
|
ClassType,
|
||||||
types.FunctionType,
|
types.FunctionType,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -40,7 +40,7 @@ import threading
|
|||||||
import cgi
|
import cgi
|
||||||
import copy
|
import copy
|
||||||
import tempfile
|
import tempfile
|
||||||
import json
|
import json as json_parser
|
||||||
|
|
||||||
|
|
||||||
FMT = '%a, %d-%b-%Y %H:%M:%S PST'
|
FMT = '%a, %d-%b-%Y %H:%M:%S PST'
|
||||||
@@ -215,7 +215,7 @@ class Request(Storage):
|
|||||||
|
|
||||||
if is_json:
|
if is_json:
|
||||||
try:
|
try:
|
||||||
json_vars = json.load(body)
|
json_vars = json_parser.load(body)
|
||||||
except:
|
except:
|
||||||
# incoherent request bodies can still be parsed "ad-hoc"
|
# incoherent request bodies can still be parsed "ad-hoc"
|
||||||
json_vars = {}
|
json_vars = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user