From bb61d9404a80179be25b788921223ddc2b2c9938 Mon Sep 17 00:00:00 2001 From: Kristen Pol Date: Sat, 20 Jan 2024 19:55:23 -0800 Subject: [PATCH] Updated file handling for multilingual sites. --- modules/quant_api/src/EventSubscriber/QuantApi.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/quant_api/src/EventSubscriber/QuantApi.php b/modules/quant_api/src/EventSubscriber/QuantApi.php index 16fd4ef2..750fd424 100644 --- a/modules/quant_api/src/EventSubscriber/QuantApi.php +++ b/modules/quant_api/src/EventSubscriber/QuantApi.php @@ -152,6 +152,9 @@ public function onOutput(QuantEvent $event) { $queue_factory = QuantQueueFactory::getInstance(); $queue = $queue_factory->get('quant_seed_worker'); + // File redirects happen when using path prefixes. + $allow_redirects = Utility::usesLanguagePathPrefixes(); + foreach ($media as $item) { // @todo Configurable to disallow remote files. // @todo Strip base domain. @@ -207,7 +210,7 @@ public function onOutput(QuantEvent $event) { $response = \Drupal::httpClient()->get($url, [ 'http_errors' => FALSE, 'headers' => $headers, - 'allow_redirects' => FALSE, + 'allow_redirects' => $allow_redirects, 'verify' => boolval($config->get('ssl_cert_verify')), ]); if ($response->getStatusCode() != 200) {