app: fix issue with json Content-Type checks
Allow the Content-Type header to specify a "charset" by only validating the start of the string. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
d1dfa86081
commit
84f46b1cb1
|
@ -293,7 +293,8 @@ class DynamicRequestHandler(AuthorizedRequestHandler):
|
|||
|
||||
def parse_args(self):
|
||||
args = self._parse_query()
|
||||
if self.request.headers.get('Content-Type', "") == "application/json":
|
||||
content_type = self.request.headers.get('Content-Type', "").strip()
|
||||
if content_type.startswith("application/json"):
|
||||
try:
|
||||
args.update(json.loads(self.request.body))
|
||||
except json.JSONDecodeError:
|
||||
|
|
Loading…
Reference in New Issue