-
Notifications
You must be signed in to change notification settings - Fork 15
Open
@shopapps
Description
in NlpClient.php line 175 you have:
if ( empty($result) || ( isset($http_response_header) && $http_response_header[0] != 'HTTP/1.0 200 OK' ) ) // empty if server is down
can you please move the check for the HTTP version to config?
if ( empty($result) || ( isset($http_response_header) && $http_response_header[0] != 'HTTP/' . config('nlp.http.version') . ' 200 OK' ) ) // empty if server is down
or even better:
if ( empty($result) || ( isset($http_response_header) && !stristr($http_response_header[0], '200 OK' ))) // empty if server is down
currently, my local build returns: "HTTP/1.1 200 OK" (so HTTP/1.1 not HTTP/1.0 ) so all my attempts to use your laravel wrapper package are failing :-(
the output of my $http_response_header
"Web64\Nlp\NlpClient::post_call Line: 173" // vendor/web64/php-nlp-client/src/NlpClient.php:173
array:6 [ // vendor/web64/php-nlp-client/src/NlpClient.php:173
0 => "HTTP/1.1 200 OK"
1 => "Server: Werkzeug/2.3.4 Python/3.11.3"
2 => "Date: 2023年5月18日 10:19:01 GMT"
3 => "Content-Type: application/json"
4 => "Content-Length: 434"
5 => "Connection: close"
]
Metadata
Metadata
Assignees
Labels
No labels