Skip to content

Commit e82fc7b

Browse files
1 parent 3ec7922 commit e82fc7b

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

src/DependencyInjection/Configuration.php

-11
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,6 @@ public function getConfigTreeBuilder()
3838
->scalarNode('proxy_url')
3939
->isRequired()
4040
->cannotBeEmpty()
41-
->validate()
42-
->always(function ($v) {
43-
try {
44-
ProxyUrlFactory::parseUrl($v);
45-
} catch (\UnexpectedValueException $e) {
46-
throw new \InvalidArgumentException($e->getMessage());
47-
}
48-
49-
return $v;
50-
})
51-
->end()
5241
->end()
5342
->scalarNode('proxy_host_filter_service')
5443
->defaultNull()

src/DependencyInjection/PHPMentorsProxyURLRewriteExtension.php

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
namespace PHPMentors\ProxyURLRewriteBundle\DependencyInjection;
1414

15+
use PHPMentors\ProxyURLRewriteBundle\ProxyUrl\ProxyUrlFactory;
1516
use Symfony\Component\Config\FileLocator;
1617
use Symfony\Component\DependencyInjection\ContainerBuilder;
1718
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
@@ -49,6 +50,13 @@ private function transformConfigToContainer(array $config, ContainerBuilder $con
4950
{
5051
if ($config['enabled']) {
5152
foreach ($config['proxy_urls'] as $id => $proxyUrl) {
53+
54+
try{
55+
ProxyUrlFactory::parseUrl($proxyUrl['path']);
56+
} catch (\UnexpectedValueException $e) {
57+
throw new \InvalidArgumentException($e->getMessage());
58+
}
59+
5260
if (class_exists('Symfony\Component\DependencyInjection\ChildDefinition')) {
5361
$definitionClass = 'Symfony\Component\DependencyInjection\ChildDefinition';
5462
} else {

0 commit comments

Comments
 (0)