Skip to content

Commit

Permalink
Check if response exists before showing information (#87)
Browse files Browse the repository at this point in the history
Tells the user otherwise.
  • Loading branch information
soullivaneuh authored and Florian Preusner committed Dec 28, 2016
1 parent 7630ef4 commit bdda71e
Showing 1 changed file with 27 additions and 17 deletions.
44 changes: 27 additions & 17 deletions Resources/views/profiler.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@
<a href="javascript:;">
<span class="method">{{ message.request.method }}</span>
<span class="url">{{ message.request.url }}</span>
<span class="response">{{ message.response.statusPhrase }} ({{ message.response.statusCode }})</span>
<span class="response">
{% if message.response %}
{{ message.response.statusPhrase }} ({{ message.response.statusCode }})
{% else %}
N/A
{% endif %}
</span>
</a>
</h3>
<div class="content" {{ firstRequest ? 'style="display: none;"': '' }}>
Expand Down Expand Up @@ -59,22 +65,26 @@
<div>
<h4>Response</h4>

<table>
<tr>
<th>Protocol Version</th>
<td>{{ message.response.protocolVersion }}</td>
</tr>
<tr>
<th>Headers</th>
<td>{{ dump(message.response.headers) }}</td>
</tr>
<tr>
<th>Body</th>
<td>
<textarea readonly id="responseBody">{{ message.response.body }}</textarea>
</td>
</tr>
</table>
{% if message.response %}
<table>
<tr>
<th>Protocol Version</th>
<td>{{ message.response.protocolVersion }}</td>
</tr>
<tr>
<th>Headers</th>
<td>{{ dump(message.response.headers) }}</td>
</tr>
<tr>
<th>Body</th>
<td>
<textarea readonly id="responseBody">{{ message.response.body }}</textarea>
</td>
</tr>
</table>
{% else %}
No response available.
{% endif %}
</div>
</div>
</div>
Expand Down

0 comments on commit bdda71e

Please sign in to comment.