🐛 | Drupal core | net:err_http2_protocol_error on Drupal 10.2.2 on production err_http2_protocol_error
Hi everyone!
It was an image upload issue on my side and got errors. First patched like below; the error gone, uploaded successfully.
Patch /public_html/core/lib/Drupal/Core/StackMiddleware/ContentLength.php #48:
From: $response->headers->set('Content-Length', strlen($content), TRUE);
To: $response->headers->set('Content-Length', strlen($content)+2, TRUE);
But then some http2 protocol errors appeared on XHR requests. After billion attempts, changed the patch like (switching from +2 to +1) and errors gone forever.
$response->headers->set('Content-Length', strlen($content)+1, TRUE);