- Issue created by @Carlitus
- Merge request !7157Added two (2) extra lenght to Content-lenght to avoid json truncated and invalid β (Open) created by Carlitus
I wonder if this is a duplicate of π Incorrect content-length header breaks HTTP/2 with net::err_http2_protocol_error Active , with the same root cause.
- πͺπΈSpain Carlitus
It's similar but i have not the err_http2_protocolol_error, and the solutions didn't work for my problem.
- π³π±Netherlands MLZR Zutphen
After Drupal update to 10.2.5 a XML sync with a other system was broken.
With the patch above- $response->headers->set('Content-Length', strlen($content), TRUE);
+ $response->headers->set('Content-Length', strlen($content)+2, TRUE);AND set ' Header always unset Content-Length ' in the .htaccess
And things are working again :-}
https://www.drupal.org/project/drupal/issues/3419024#comment-15539269 π Incorrect content-length header breaks HTTP/2 with net::err_http2_protocol_error Active
Thanks @Carlitus for reporting and make a solution.
- πͺπΈSpain Carlitus
Your welcome @MLZR, I am glad that my solution has been able to help more people.
- πͺπΈSpain Carlitus
@cilifen, the workaround it's copied from here, you can see that @MLZR links to this issue.
We have two or three issues where the content length header is wrong due to a change in Drupal core.
- πͺπΈSpain Carlitus
What do you recommend? should I put this MR in the other issue?
- π¬π§United Kingdom longwave UK
This isn't the correct fix though, as can be seen by the failing tests - we need to figure out why this is two characters out sometimes. Are you also using nginx, or does this happen on Apache as well?
- Status changed to Postponed: needs info
8 months ago 10:24pm 11 April 2024 - π¬π§United Kingdom longwave UK
We need someone who can reproduce this to log the response at the point that we calculate Content-Length, and compare it to the response that nginx sends out, and see what the actual difference is - presumably two extra characters are present, but what are they?
I have two configured Apache servers; one with FastCGI and another with php-fpm. On the server with php-fpm I'm getting no content type served from files in "/system/files"; presumably the same issue that others are complaining about. Making changes to the recommended above files does nothing; so this is not a correct fix. I hope this helps?
- π¬π§United Kingdom catch
There's another issue in the queue which sounds similar, where the issue has been whitespace before the opening
<?php
PHP tag, it would be worth checking for that. Will link the other issue when I find it. - π¬π§United Kingdom longwave UK
@catch this reminds me of #3225466: Blank line in .module file causes blank line in HTML output β which I debugged by adding code to
ModuleHandler::loadInclude
to detect which file caused the issue - I wonder if that should be a standard core feature. - π¬π§United Kingdom catch
Given the number of people running into this that seems worth looking into yeah.
- πͺπΈSpain Carlitus
yes, thats it. It's in bat_module, without the whitespace and also without this patch all works well.
https://www.drupal.org/project/bat_api/issues/3411329#comment-15590410 π With Drupal 10.2.0 the rest api doesn't return a valid json Needs workThanks!
- π³πΏNew Zealand quietone
Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to our policies.
- Status changed to Closed: won't fix
5 months ago 6:39am 24 July 2024 - πͺπΈSpain Carlitus
I think i can close the issue, because i was another module that cause this.