@@ -427,6 +427,12 @@ private function loadVarnish(ContainerBuilder $container, XmlFileLoader $loader,
427427 $ container ->setParameter ('fos_http_cache.proxy_client.varnish.options ' , $ options );
428428
429429 $ loader ->load ('varnish.xml ' );
430+
431+ $ requestFactory = isset ($ config ['http ' ]['request_factory ' ])
432+ ? new Reference ($ config ['http ' ]['request_factory ' ])
433+ : null ;
434+ $ container ->getDefinition ('fos_http_cache.proxy_client.varnish ' )
435+ ->replaceArgument (2 , $ requestFactory );
430436 }
431437
432438 private function loadNginx (ContainerBuilder $ container , XmlFileLoader $ loader , array $ config ): void
@@ -436,6 +442,12 @@ private function loadNginx(ContainerBuilder $container, XmlFileLoader $loader, a
436442 'purge_location ' => $ config ['purge_location ' ],
437443 ]);
438444 $ loader ->load ('nginx.xml ' );
445+
446+ $ requestFactory = isset ($ config ['http ' ]['request_factory ' ])
447+ ? new Reference ($ config ['http ' ]['request_factory ' ])
448+ : null ;
449+ $ container ->getDefinition ('fos_http_cache.proxy_client.nginx ' )
450+ ->replaceArgument (2 , $ requestFactory );
439451 }
440452
441453 private function loadSymfony (ContainerBuilder $ container , XmlFileLoader $ loader , array $ config ): void
@@ -462,6 +474,12 @@ private function loadSymfony(ContainerBuilder $container, XmlFileLoader $loader,
462474 $ container ->setParameter ('fos_http_cache.proxy_client.symfony.options ' , $ options );
463475
464476 $ loader ->load ('symfony.xml ' );
477+
478+ $ requestFactory = isset ($ config ['http ' ]['request_factory ' ])
479+ ? new Reference ($ config ['http ' ]['request_factory ' ])
480+ : null ;
481+ $ container ->getDefinition ('fos_http_cache.proxy_client.symfony ' )
482+ ->replaceArgument (2 , $ requestFactory );
465483 }
466484
467485 private function loadCloudflare (ContainerBuilder $ container , XmlFileLoader $ loader , array $ config ): void
@@ -475,6 +493,12 @@ private function loadCloudflare(ContainerBuilder $container, XmlFileLoader $load
475493 $ container ->setParameter ('fos_http_cache.proxy_client.cloudflare.options ' , $ options );
476494
477495 $ loader ->load ('cloudflare.xml ' );
496+
497+ $ requestFactory = isset ($ config ['http ' ]['request_factory ' ])
498+ ? new Reference ($ config ['http ' ]['request_factory ' ])
499+ : null ;
500+ $ container ->getDefinition ('fos_http_cache.proxy_client.cloudflare ' )
501+ ->replaceArgument (2 , $ requestFactory );
478502 }
479503
480504 private function loadCloudfront (ContainerBuilder $ container , XmlFileLoader $ loader , array $ config ): void
@@ -511,6 +535,12 @@ private function loadFastly(ContainerBuilder $container, XmlFileLoader $loader,
511535 $ container ->setParameter ('fos_http_cache.proxy_client.fastly.options ' , $ options );
512536
513537 $ loader ->load ('fastly.xml ' );
538+
539+ $ requestFactory = isset ($ config ['http ' ]['request_factory ' ])
540+ ? new Reference ($ config ['http ' ]['request_factory ' ])
541+ : null ;
542+ $ container ->getDefinition ('fos_http_cache.proxy_client.fastly ' )
543+ ->replaceArgument (2 , $ requestFactory );
514544 }
515545
516546 /**
0 commit comments