feature #28936 [WebProfilerBundle] Replay referer URL (ro0NL)

This PR was merged into the 4.2-dev branch.

Discussion
----------

[WebProfilerBundle] Replay referer URL

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #26226
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

For non GET/HEAD requests (e.g. POST) that have a referer URL; allow to replay it. And thereby fix the missing navigation piece to get back to your application.

Default

![image](https://user-images.githubusercontent.com/1047696/47259042-3c86ea80-d4a4-11e8-99f7-c3941beaa72c.png)

On hover

![image](https://user-images.githubusercontent.com/1047696/47259048-54f70500-d4a4-11e8-9e44-e20121f5b04f.png)

Commits
-------

9020d49765 [WebProfilerBundle] Replay referer URL
This commit is contained in:
Fabien Potencier 2018-10-21 08:57:01 +02:00
commit 316e95c06c
2 changed files with 13 additions and 0 deletions

View File

@ -16,6 +16,10 @@
<a href="{{ profile.url }}">{{ profile.url }}</a>
{% else %}
{{ profile.url }}
{% set referer = profile.collector('request').requestheaders.get('referer') %}
{% if referer %}
<a href="{{ referer }}" class="referer">Replay referer URL</a>
{% endif %}
{% endif %}
</h2>

View File

@ -585,10 +585,19 @@ tr.status-warning td {
font-size: 21px;
margin: 0;
text-decoration: none;
vertical-align: middle;
}
#summary h2 a:hover {
text-decoration: underline;
}
#summary h2 a.referer {
margin-left: .5em;
font-size: 75%;
color: rgba(255, 255, 255, 0.5);
}
#summary h2 a.referer:before {
content: '\1F503\00a0';
}
#summary .status-success { background: var(--color-success); }
#summary .status-warning { background: var(--color-warning); }