diff --git a/Resources/views/Collector/partials/auth.html.twig b/Resources/views/Collector/partials/auth.html.twig index 1d92ab3..a34a128 100644 --- a/Resources/views/Collector/partials/auth.html.twig +++ b/Resources/views/Collector/partials/auth.html.twig @@ -10,8 +10,8 @@ Request {% if call.request and call.request.jwt|default(false) %} - {{ dump(call.request.jwt.decoded.header|json_decode) }} - {{ dump(call.request.jwt.decoded.payload|json_decode) }} + {{ dump(call.request.jwt.decoded.header|simple_json_decode) }} + {{ dump(call.request.jwt.decoded.payload|simple_json_decode) }} {% endif %} @@ -19,8 +19,8 @@ Response {% if call.response and call.response.jwt|default(false) %} - {{ dump(call.response.jwt.decoded.header|json_decode) }} - {{ dump(call.response.jwt.decoded.payload|json_decode) }} + {{ dump(call.response.jwt.decoded.header|simple_json_decode) }} + {{ dump(call.response.jwt.decoded.payload|simple_json_decode) }} {% endif %} diff --git a/Twig/Extension.php b/Twig/Extension.php index 8fea4ec..ffe795a 100644 --- a/Twig/Extension.php +++ b/Twig/Extension.php @@ -33,10 +33,11 @@ public function getFilters(): array new TwigFilter('simple_http_beautify', array($this, 'format'), $safe), new TwigFilter('simple_http_format_http_code', array($this, 'formatHttpCode'), $safe), new TwigFilter('simple_http_format_http_code_as_badge', array($this, 'formatHttpCodeAsSfBadge'), $safe), - new TwigFilter('simple_http_md5', array($this, 'md5')), + new TwigFilter('simple_http_md5', 'md5'), new TwigFilter('simple_http_include_asset', array($this, 'assetInclude'), $safe), new TwigFilter('simple_http_format_ms', array($this, 'formatMilliseconds')), new TwigFilter('simple_http_format_num', array($this, 'numberFormat')), + new TwigFilter('simple_json_decode', 'json_decode'), ]; } @@ -72,15 +73,6 @@ public function formatMilliseconds($ms): string return $this->numberFormat($ms * 1000) . " ms"; } - /** - * @param $str - * @return string - */ - public function md5($str): string - { - return md5($str); - } - public function assetInclude(string $file): string { try {