Skip to content

Commit b240b2e

Browse files
Merge branch '3.0'
* 3.0: use stable 1.0.x Composer versions Fix typo in VarDumper README [DI] Fix AutowirePass fatal error with classes that have non-existing parents [DependencyInjection] Tests for AutowirePass with missing parent class [WebProfilerBunde] Give an absolute url in case the request occured from another domain Conflicts: src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php
2 parents 87f80c5 + 32be10a commit b240b2e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

EventListener/WebDebugToolbarListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function onKernelResponse(FilterResponseEvent $event)
6565
try {
6666
$response->headers->set(
6767
'X-Debug-Token-Link',
68-
$this->urlGenerator->generate('_profiler', array('token' => $response->headers->get('X-Debug-Token')))
68+
$this->urlGenerator->generate('_profiler', array('token' => $response->headers->get('X-Debug-Token')), UrlGeneratorInterface::ABSOLUTE_URL)
6969
);
7070
} catch (\Exception $e) {
7171
$response->headers->set('X-Debug-Error', get_class($e).': '.$e->getMessage());

Tests/EventListener/WebDebugToolbarListenerTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\HttpFoundation\Response;
1717
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
1818
use Symfony\Component\HttpKernel\HttpKernelInterface;
19+
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
1920

2021
class WebDebugToolbarListenerTest extends \PHPUnit_Framework_TestCase
2122
{
@@ -195,16 +196,16 @@ public function testXDebugUrlHeader()
195196
$urlGenerator
196197
->expects($this->once())
197198
->method('generate')
198-
->with('_profiler', array('token' => 'xxxxxxxx'))
199-
->will($this->returnValue('/_profiler/xxxxxxxx'))
199+
->with('_profiler', array('token' => 'xxxxxxxx'), UrlGeneratorInterface::ABSOLUTE_URL)
200+
->will($this->returnValue('http://mydomain.com/_profiler/xxxxxxxx'))
200201
;
201202

202203
$event = new FilterResponseEvent($this->getKernelMock(), $this->getRequestMock(), HttpKernelInterface::MASTER_REQUEST, $response);
203204

204205
$listener = new WebDebugToolbarListener($this->getTwigMock(), false, WebDebugToolbarListener::ENABLED, 'bottom', $urlGenerator);
205206
$listener->onKernelResponse($event);
206207

207-
$this->assertEquals('/_profiler/xxxxxxxx', $response->headers->get('X-Debug-Token-Link'));
208+
$this->assertEquals('http://mydomain.com/_profiler/xxxxxxxx', $response->headers->get('X-Debug-Token-Link'));
208209
}
209210

210211
public function testThrowingUrlGenerator()

0 commit comments

Comments
 (0)