Commit 8d2cfcf6 authored by tufengqi's avatar tufengqi

fix

parent d8fcfc90
......@@ -95,7 +95,7 @@ class ThriftServiceFactoryProxy
'http',
$service_real
);
$socket->addHeaders(['Contents-Type' => $content_type_mapping[$content_type]]);
$socket->addHeaders(['Contents-Type' => $this->request_base_params['content_type_str']]);
} else {
$socket = new TCurlClient(
$this->request_base_params['host'],
......@@ -104,12 +104,12 @@ class ThriftServiceFactoryProxy
'http',
$this->service_real_config
);
$socket->addHeaders(['Content-type' => $content_type_mapping[$content_type]]);
$socket->addHeaders(['Content-type' => $this->request_base_params['content_type_str']]);
}
$transport = new \Thrift\Transport\TBufferedTransport($socket, 1024, 1024);
if (self::BINARY === $content_type) {
if (self::BINARY === $this->request_base_params['content_type']) {
$protocol = new \Thrift\Protocol\TBinaryProtocol($transport, $strict_read = true, $strict_write = true);
} elseif (self::JSON === $content_type) {
} elseif (self::JSON === $this->request_base_params['content_type']) {
$protocol = new \Thrift\Protocol\TJSONProtocol($transport);
}
$this->instance = new $this->class_name($protocol);
......
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