]> _ Git - cubist_net.git/commitdiff
wip #8047 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 10 Mar 2026 10:26:17 +0000 (11:26 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 10 Mar 2026 10:26:17 +0000 (11:26 +0100)
src/HTTP.php

index 59a0d4e2a960ef41484682b78961921ee4a9d2d3..cca9e632d480504a13908647980910d74a9775ad 100644 (file)
@@ -107,7 +107,7 @@ class HTTP
                     'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
                     'Accept-Encoding' => 'gzip, deflate, br, zstd',
                     'Accept-Language' => 'fr-FR,fr;q=0.9,en-GB;q=0.8,en;q=0.7,en-US;q=0.6',
-                    'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36',
+                    'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:149.0) Gecko/20100101 Firefox/149.0',
                     'Upgrade-Insecure-Requests' => '1',
                     'Cache-Control' => 'no-cache',
                     'Pragma' => 'no-cache',
@@ -116,6 +116,10 @@ class HTTP
                 ];
         }
         $options = ['timeout' => $timeout, 'http_errors' => false, 'headers' => $headers, 'allow_redirects' => ['max' => 10, 'track_redirects' => true]] + $options;
+        if (isset($options['ajax']) && $options['ajax']) {
+            unset($options['ajax']);
+            $options += ["X-Requested-With" > "XMLHttpRequest"];
+        }
         if (self::$_cookiesJar) {
             $options["cookies"] = self::$_cookiesJar;
         }