Skip to content

Commit

Permalink
[WebProfilerBundle][HttpClient] Added profiler links in the Web Profi…
Browse files Browse the repository at this point in the history
…ler -> Http Client panel
  • Loading branch information
cristagu authored and fabpot committed Jan 22, 2020
1 parent af4035d commit 70e11f9
Showing 1 changed file with 22 additions and 0 deletions.
Expand Up @@ -54,6 +54,18 @@
{% else %}
<h4>Requests</h4>
{% for trace in client.traces %}
{% set profiler_token = '' %}
{% set profiler_link = '' %}
{% if trace.info.response_headers is defined %}
{% for header in trace.info.response_headers %}
{% if header matches '/^x-debug-token: .*$/i' %}
{% set profiler_token = (header.getValue | slice('x-debug-token: ' | length)) %}
{% endif %}
{% if header matches '/^x-debug-token-link: .*$/i' %}
{% set profiler_link = (header.getValue | slice('x-debug-token-link: ' | length)) %}
{% endif %}
{% endfor %}
{% endif %}
<table>
<thead>
<tr>
Expand All @@ -66,6 +78,11 @@
{{ profiler_dump(trace.options, maxDepth=1) }}
{% endif %}
</th>
{% if profiler_token and profiler_link %}
<th>
Profile
</th>
{% endif %}
</tr>
</thead>
<tbody>
Expand All @@ -85,6 +102,11 @@
<td>
{{ profiler_dump(trace.info, maxDepth=1) }}
</td>
{% if profiler_token and profiler_link %}
<td>
<span><a href="{{ profiler_link }}" target="_blank">{{ profiler_token }}</a></span>
</td>
{% endif %}
</tr>
</tbody>
</table>
Expand Down

0 comments on commit 70e11f9

Please sign in to comment.