Skip to content

Commit

Permalink
Fixes muatik#120 backslash in body issue
Browse files Browse the repository at this point in the history
  • Loading branch information
anandtripathi5 authored Dec 14, 2021
1 parent 47869d7 commit ae10081
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions flask_profiler/flask_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import functools
import re
import time

import json
from pprint import pprint as pp

import logging
Expand Down Expand Up @@ -123,11 +123,14 @@ def wrapper(*args, **kwargs):
def wrapHttpEndpoint(f):
@functools.wraps(f)
def wrapper(*args, **kwargs):
body = request.data.decode("utf-8", "strict")
if body:
body = json.loads(body)
context = {
"url": request.base_url,
"args": dict(request.args.items()),
"form": dict(request.form.items()),
"body": request.data.decode("utf-8", "strict"),
"body": body,
"headers": dict(request.headers.items()),
"func": request.endpoint,
"ip": request.remote_addr
Expand Down

0 comments on commit ae10081

Please sign in to comment.