Commit fe20eca2 authored by tufengqi's avatar tufengqi

fix cookie not match service

parent 21c5c59c
......@@ -210,8 +210,8 @@ class TCurlClient extends \Thrift\Transport\TTransport
curl_setopt(self::$curlHandle, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt(self::$curlHandle, CURLOPT_FOLLOWLOCATION, true);
curl_setopt(self::$curlHandle, CURLOPT_MAXREDIRS, 1);
if (defined('VERSION_KEY') && defined('VERSION_VALUE_NO_PTEFIX')) {
$cookie = VERSION_KEY . '=' . VERSION_VALUE_NO_PTEFIX;
if (defined('VERSION_KEY') && !empty($GLOBALS['GLOBAL_VERSION_VALUE_NO_PTEFIX'])) {
$cookie = VERSION_KEY . '=' . $GLOBALS['GLOBAL_VERSION_VALUE_NO_PTEFIX'];
curl_setopt(self::$curlHandle, CURLOPT_COOKIE, $cookie);
}
}
......
......@@ -215,9 +215,9 @@ class TGuzzleClient extends \Thrift\Transport\TTransport
'Content-Length' => TStringFuncFactory::create()->strlen($this->request_)
];
$headers = array_merge($defaultHeaders, $this->headers_);
if (defined('VERSION_KEY') && defined('VERSION_VALUE_NO_PTEFIX')) {
if (defined('VERSION_KEY') && !empty($GLOBALS['GLOBAL_VERSION_VALUE_NO_PTEFIX'])) {
$headers = array_merge($headers, [
'cookies' => [VERSION_KEY => VERSION_VALUE_NO_PTEFIX]
'cookies' => [VERSION_KEY => $GLOBALS['GLOBAL_VERSION_VALUE_NO_PTEFIX']]
]);
}
// Send an asynchronous request.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment