Skip to content
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

[4.x] Fix JHTTP socket transport http version #43001

Merged
merged 2 commits into from
Mar 13, 2024

Conversation

SniperSister
Copy link
Contributor

@SniperSister SniperSister commented Mar 11, 2024

Pull Request for Issue #38963 and #42973

Summary of Changes

In #35568 a change was merged into the JHTTP socket driver, increasing the accepted HTTP version for the client from 1.0 to 1.1.

That change introduce the issue described in #38963: HTTP 1.1 defines the chunked transfer mode which is mandatory for all clients implementing HTTP 1.1 - as our socket-based client however does not support chunked responses, a chunked response causes an infinite loop.

Framework implications

Once tested, please also merge joomla-framework/http#54

Testing Instructions

  • Create a socket-based JHTTP request to a server responding with a chunked response, i.e. by using this code block:
    $http = \Joomla\CMS\Http\HttpFactory::getHttp([], 'socket'); $response = $http->get('https://update.joomla.org/cms/root.json');

Actual result BEFORE applying this Pull Request

  • Infinite loop

Expected result AFTER applying this Pull Request

  • Response returned

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@HLeithner
Copy link
Member

I have tested this item ✅ successfully on 2668f90

same pr as 43002 which works as expected


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43001.

@SniperSister
Copy link
Contributor Author

The updated framework package is now included in this PR

@brianteeman
Copy link
Contributor

With php curl not enabled I dont get the infinite loop 👍

But I do get the tuf errror

0 No transport driver available.

No. Function Location
1 () JROOT\libraries\vendor\joomla\http\src\HttpFactory.php:40
2 Joomla\Http\HttpFactory->getHttp() JROOT\libraries\src\TUF\TufFetcher.php:74
3 Joomla\CMS\TUF\TufFetcher->__construct() JROOT\libraries\src\Updater\Update.php:540
4 Joomla\CMS\Updater\Update->loadFromTuf() JROOT\administrator\components\com_joomlaupdate\src\Model\UpdateModel.php:324
5 Joomla\Component\Joomlaupdate\Administrator\Model\UpdateModel->getUpdateInformation() JROOT\libraries\src\MVC\View\AbstractView.php:159
6 Joomla\CMS\MVC\View\AbstractView->get() JROOT\administrator\components\com_joomlaupdate\src\View\Joomlaupdate\HtmlView.php:166
7 Joomla\Component\Joomlaupdate\Administrator\View\Joomlaupdate\HtmlView->display() JROOT\administrator\components\com_joomlaupdate\src\Controller\DisplayController.php:88
8 Joomla\Component\Joomlaupdate\Administrator\Controller\DisplayController->display() JROOT\libraries\src\MVC\Controller\BaseController.php:730
9 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT\libraries\src\Dispatcher\ComponentDispatcher.php:143
10 Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() JROOT\libraries\src\Component\ComponentHelper.php:361
11 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT\libraries\src\Application\AdministratorApplication.php:150
12 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT\libraries\src\Application\AdministratorApplication.php:195
13 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT\libraries\src\Application\CMSApplication.php:306
14 Joomla\CMS\Application\CMSApplication->execute() JROOT\administrator\includes\app.php:58
15 require_once() JROOT\administrator\index.php:32

@SniperSister
Copy link
Contributor Author

@brianteeman the PR fixes the general issue in the driver and allows the TUF updater to work with non-curl transports; the actual change to the updater, that removes the pinning to curl, is still pending in #42900 - do you have these changes in your working copy too?

@brianteeman
Copy link
Contributor

No io do not because that PR is for j5 and this PR is for j4

@SniperSister
Copy link
Contributor Author

Ok but the posted stacktrace mentions the TUFFetcher which isn't present in J4 either, so I'm not sure that the actual test setup is that you used to to get that trace?

@brianteeman
Copy link
Contributor

maybe ny branch is fubar. will rebuild it again and retest

@brianteeman
Copy link
Contributor

brianteeman commented Mar 12, 2024

SORRY - I checked the wrong site. I applied the pr to one site and checked it on a different site

@brianteeman
Copy link
Contributor

I have tested this item ✅ successfully on cf3b95c


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43001.

@richard67
Copy link
Member

@HLeithner Could you test again with the included dependency update. Thanks in advance.

@HLeithner
Copy link
Member

@HLeithner Could you test again with the included dependency update. Thanks in advance.

my test is still valid because I tested it with and without dependency update by accident....

@richard67
Copy link
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43001.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Mar 12, 2024
@MacJoom MacJoom self-assigned this Mar 13, 2024
@MacJoom MacJoom added this to the Joomla! 4.4.4 milestone Mar 13, 2024
@MacJoom MacJoom merged commit 069d858 into joomla:4.4-dev Mar 13, 2024
4 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Mar 13, 2024
@MacJoom
Copy link
Contributor

MacJoom commented Mar 13, 2024

Thank you all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants