Skip to content

Commit

Permalink
Merge pull request #471 from php-http/1-to-2
Browse files Browse the repository at this point in the history
1 to 2
  • Loading branch information
dbu authored Sep 4, 2024
2 parents 578486b + 9ddc2b4 commit 4d1ca68
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 8 additions & 10 deletions src/Resources/views/stack.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@
{% endif %}
<span class="label httplug-method httplug-method-{{ stack.requestMethod|lower }}">{{ stack.requestMethod }}</span>
</div>
{% apply spaceless %}
<div class="label httplug-stack-header-target">
<span class="httplug-scheme">{{ stack.requestScheme }}://</span>
<span class="httplug-host">{{ stack.requestHost }}</span>
{% if stack.requestPort not in [null, 80, 443] %}
<span class="httplug-port">:{{ stack.requestPort }}</span>
{% endif %}
<span class="httplug-target">{{ (stack.requestTarget|default('/') starts with '/' ? '' : '/') ~ stack.requestTarget }}</span>
</div>
{% endapply %}
<div class="label httplug-stack-header-target">
<span class="httplug-scheme">{{ stack.requestScheme }}://</span>
<span class="httplug-host">{{ stack.requestHost }}</span>
{% if stack.requestPort not in [null, 80, 443] %}
<span class="httplug-port">:{{ stack.requestPort }}</span>
{% endif %}
<span class="httplug-target">{{ (stack.requestTarget|default('/') starts with '/' ? '' : '/') ~ stack.requestTarget }}</span>
</div>
<div>
<span class="label httplug-duration">{{ stack.duration|number_format }} ms</span>
{% if stack.responseCode >= 400 and stack.responseCode <= 599 %}
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/ProfilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testShowProfiler(): void
$client->request('GET', '/_profiler/latest?panel=httplug');
$content = $client->getResponse()->getContent();
$this->assertStringContainsString(<<<HTML
<div class="label httplug-stack-header-target"><span class="httplug-scheme">https://</span><span class="httplug-host">jsonplaceholder.typicode.com</span><span class="httplug-target">/posts/1</span></div>
<span class="httplug-host">jsonplaceholder.typicode.com</span>
HTML, $content);
}
}

0 comments on commit 4d1ca68

Please sign in to comment.