Skip to content

Product update: cURL Error: HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) #335

@giobi

Description

@giobi

This happens on api call on endpoint for product update.
It's fixed by setting a different http version via curl_setopt

in file src/WooCommer/HttpClient/HttpClient.php after line 355
\curl_setopt($this->ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);

or better calling runtime not to break vendor package in you calls
$api = new Client($url, $consumerKey, $consumerSecret, [$version]); $api->http->setCustomCurlOptions([ CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1 ]);

of course it's an hotfix and it should be refactored probably

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions