You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -500,7 +512,7 @@ private function addProxyClientSection(ArrayNodeDefinition $rootNode)
500
512
thrownewInvalidConfigurationException(sprintf('You can only set one of "http.servers" or "http.servers_from_jsonenv" but not both to avoid ambiguity for the proxy "%s"', $proxyName));
501
513
}
502
514
503
-
if (!\in_array($proxyName, ['noop', 'default', 'symfony'])) {
515
+
if (!\in_array($proxyName, ['noop', 'default', 'symfony', 'cloudflare'])) {
504
516
if (!$arrayServersConfigured && !$jsonServersConfigured) {
505
517
thrownewInvalidConfigurationException(sprintf('The "http.servers" or "http.servers_from_jsonenv" section must be defined for the proxy "%s"', $proxyName));
506
518
}
@@ -564,6 +576,36 @@ private function getHttpDispatcherNode()
564
576
return$node;
565
577
}
566
578
579
+
privatefunctiongetCloudflareHttpDispatcherNode()
580
+
{
581
+
$treeBuilder = newTreeBuilder('http');
582
+
583
+
// Keep compatibility with symfony/config < 4.2
584
+
if (!method_exists($treeBuilder, 'getRootNode')) {
585
+
$node = $treeBuilder->root('http');
586
+
} else {
587
+
$node = $treeBuilder->getRootNode();
588
+
}
589
+
590
+
$node
591
+
->addDefaultsIfNotSet()
592
+
->children()
593
+
->arrayNode('servers')
594
+
->info('Addresses of the hosts the caching proxy is running on. The values may be hostnames or ips, and with :port if not the default port 80.')
595
+
->useAttributeAsKey('name')
596
+
->requiresAtLeastOneElement()
597
+
->defaultValue(['https://api.cloudflare.com'])
598
+
->prototype('scalar')->end()
599
+
->end()
600
+
->scalarNode('http_client')
601
+
->defaultNull()
602
+
->info('Httplug async client service name to use for sending the requests.')
0 commit comments