From: Vincent Vanwaelscappel Date: Tue, 10 Mar 2026 10:26:17 +0000 (+0100) Subject: wip #8047 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=18ffbcb7c40575e8aa6d6016e50781752422a47f;p=cubist_net.git wip #8047 @0.25 --- diff --git a/src/HTTP.php b/src/HTTP.php index 59a0d4e..cca9e63 100644 --- a/src/HTTP.php +++ b/src/HTTP.php @@ -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; }