Return empty response for empty or non-existent fields

parent d3245da5
...@@ -114,15 +114,15 @@ class App extends BaseApp ...@@ -114,15 +114,15 @@ class App extends BaseApp
$response_texts = array_map(function ($v) use ($parsed_result) { $response_texts = array_map(function ($v) use ($parsed_result) {
return isset($parsed_result['inspectionResult'][$v]) ? return isset($parsed_result['inspectionResult'][$v]) ?
$parsed_result['inspectionResult'][$v] : $parsed_result['inspectionResult'][$v] :
null; ''; // null
}, $field_names); }, $field_names);
if (in_array(null, $response_texts)) { // if (in_array(null, $response_texts)) {
return $res->withJson(array_merge(BaseApp::coreResponseData(false), [ // return $res->withJson(array_merge(BaseApp::coreResponseData(false), [
'message' => 'Error: Service Call Parameters Error, fields query parameter has unknown fields' // 'message' => 'Error: Service Call Parameters Error, fields query parameter has unknown fields'
]), 400); // ]), 400);
} else { // } else {
return $this->withTextReady($res, implode(',', $response_texts), 200); return $this->withTextReady($res, implode(',', $response_texts), 200);
} // }
} }
return $this->withJsonReady($res, $results['response'], $results['http_status']); return $this->withJsonReady($res, $results['response'], $results['http_status']);
} else { } else {
......
...@@ -32,6 +32,7 @@ class Client ...@@ -32,6 +32,7 @@ class Client
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_USERAGENT, "OSTEAM SLIM client"); curl_setopt($ch, CURLOPT_USERAGENT, "OSTEAM SLIM client");
if (isset($this->_settings['NO_SAFE_CURL']) && $this->_settings['NO_SAFE_CURL'] === true) { if (isset($this->_settings['NO_SAFE_CURL']) && $this->_settings['NO_SAFE_CURL'] === true) {
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
} }
......
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