-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VKClientException: Invalid http status: 0 при работе через HTTP/2 #36
Comments
Да, та же проблема. |
мое решение: protected function getHttpStatus(string $raw_response_header): int {
|
@Nik-mmzd проблема актуальна. Проект заброшен?
Релиз 5.101.0
|
Я подебажил немного. Статус 200 через curl можно получить достаточно просто без всяких регулярок. public function sendRequest(string $url, array $opts) {
$curl = curl_init($url);
curl_setopt_array($curl, $this->initial_opts + $opts);
$response = curl_exec($curl);
$curl_error_code = curl_errno($curl);
$curl_error = curl_error($curl);
// The last response code
$http_code = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
curl_close($curl);
if ($curl_error || $curl_error_code) {
$error_msg = "Failed curl request. Curl error {$curl_error_code}";
if ($curl_error) {
$error_msg .= ": {$curl_error}";
}
$error_msg .= '.';
throw new TransportRequestException($error_msg);
}
return $this->parseRawResponse($http_code, $response);
} P.S. Увидел в мастере изменения getHttpStatus не выпилили |
Подготовил PR #82 |
https://github.com/VKCOM/vk-php-sdk/blob/master/src/VK/TransportClient/Curl/CurlHttpClient.php#L187
Не может распарсить HTTP status code при запросе через HTTP/2 (
HTTP/2 401
не попадает под регулярку)The text was updated successfully, but these errors were encountered: