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

Make Curl Client HTTP/2 compatible #1137

Merged
merged 4 commits into from
Aug 3, 2022
Merged

Conversation

Schrank
Copy link
Contributor

@Schrank Schrank commented Aug 6, 2020

  • Refactoring Mage_HTTP_Client_Curl::parseHeaders

Manual testing scenarios (*)

Before this fails with Exception: Invalid response line returned from server: HTTP/2 301 after the change it works.

$c = new Mage_HTTP_Client_Curl();
$c->get('https://facebook.com');

Questions or comments

  • I'm not sure wether HTTP/2 allows Status Codes (line 473)
  • this is PHP 7.1 code (not sure what openmage is expecting), list shortcut and return void

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)

colinmollenhour
colinmollenhour previously approved these changes Aug 6, 2020
@github-actions github-actions bot added Component: lib/Mage Relates to lib/Mage Component: lib/* Relates to lib/* labels Aug 6, 2020
Copy link
Contributor

@sreichel sreichel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks fior PR.

Again ... what about short array syntax? I'd prefer it and see a huge PR incoming ... :P.

@theroch
Copy link
Contributor

theroch commented Aug 7, 2020

Thanks for your PR.
Should Openmage support PHP 7.0 anymore? PHP 7.0 is EOL since over a year and most linux distributions supports newer php versions. PHP 7.1 is availabe since december 2016.

Copy link
Contributor

@theroch theroch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for PHP 7.1 and up

theroch
theroch previously approved these changes Aug 7, 2020
Copy link
Contributor

@theroch theroch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is now compatible to PHP 7.0 and newer

@sreichel
Copy link
Contributor

sreichel commented Aug 7, 2020

Questions or comments

  • this is PHP 7.1 code (not sure what openmage is expecting), list shortcut and return void

I'd like to make use of it, but not in the main release line. Guess dropping php-7.0 support would break a lot installations.

@colinmollenhour @Flyingmana not sure about planned release strategy, but setting min requirements to php-7.3 for develop/future branch could be a start.

Copy link
Contributor

@tmotyl tmotyl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add support for http 1.0

@sreichel sreichel added the PHP7 label Jan 10, 2021
@tmotyl tmotyl dismissed stale reviews from theroch and colinmollenhour via 808d1ee May 7, 2021 11:42
Copy link
Contributor

@tmotyl tmotyl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code should be made 7.0 compatible

@tmotyl
Copy link
Contributor

tmotyl commented May 7, 2021

hmm, I see it's already 7.0 compatible.
Alternative solution would be to force http 1.1 by adding:

        $this->curlOption(CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);

here:
https://github.com/openmage/magento-lts/blob/1.9.4.x/lib/Mage/HTTP/Client/Curl.php#L354

I've tested the patch on php 7.4 and 7.0 and it works

@sreichel would you mind taking a look again?

tmotyl
tmotyl previously approved these changes May 7, 2021
Schrank and others added 3 commits July 18, 2022 13:27
- I'm not sure wether HTTP/2 allows Status Codes (line 473)
- this is PHP 7.1 code (not sure what openmage is expecting), list shortcut and return void
Remove list shortcut and void return type
Co-authored-by: sv3n <[email protected]>
@fballiano
Copy link
Contributor

Sorry guys I rebased the PR and made a small change to 2 "if" statements (since the notation that was used is almost never used in our code)

@fballiano fballiano merged commit 7f352b6 into OpenMage:1.9.4.x Aug 3, 2022
sreichel added a commit that referenced this pull request Aug 12, 2022
* Merge PR #2342

* Revert "Add basic text for Ukraine (#2074)" (#2325)

This reverts commit 33dfa26.

* Mage_Catalog_Model_Product_Attribute_Backend_Groupprice_Abstract: avoid loading all websites when using only the current one (#2351)

* Added support for HTTP2 to Mage_HTTP_Client_Curl (#1137)

* Blocked access to all dot files (#2349)

* Capitalization Adjustment Regarding CamelCase in Method Names (#2365)

* refactor: Adjusted capitalization of two public methods.

* refactor: Adjusted capitalization of one protected method.

* refactor: Adjusted capitalization of where call.

* chore: Removed fixed error from phpstan baseline.

* Some microoptimization (#2335)

* Avoid duplicate method calls

* Replaced array_push()

* Changed substr() third parameter

* Use array_key_exists()

* php7 opcode - internal functions

* Enclosed error with <pre> tag for prettier error print (if developer mode is enabled). (#2368)

* Updated phpstan to 1.8.2 (#2367)

* Escape product titles in MSRP JavaScript (#2366)

* Product names were not escaped. If contained a double quote, would break the JavaScript for MSRP/MAP

* update contribution list

* Update boxes.css (#2330)

* Force describeTable() to use read DB adapter (#2371)

* Do not install n98/n98_layouthelper (#2373)

* Add apt update to XML validation workflow (#2376)

* Merged PR #2375

* Replace remaining "sizeof" calls with "count" (#2369)

* Remove DISCLAIMER and change Magento -> OpenMage in header (#2297)

* Added label for phpstan cosmetic changes (#2384)

* Added weight to salesOrderShipmentAddTrack API (#1377)

* PHPStan/DOCBlock fixes (#2336)

* Updated docs for email addTo() (#2382)

* Updated phpstan experimental (#2386)

* Cosmetic changes to Mage_Payment_Model_Method_Abstract::validate() (#2388)

* Replaced join() calls with implode() (#2389)

* Hidden empty sub menu from backend (#2391)

* Remove Thumbs.db file (#2394)

* Support PHP 8.1 in composer.json (#2378)

* php condition in composer.json

This solves the issue related to php versions > 8.1

* Reduced condition for PHP requirement

* Changed PHP requirement

* Updated version in Ubuntu 22.04 based on PHP 8.1.2

* Composer.lock updated in Ubuntu 20.04 (PHP 8.1.2)

* Update composer.lock

* Update composer.lock

* Blocked various file types in .htaccess (#2359)

* Color swatches work with disparate product IDs (#2390)

* Move Credit Memo at the end of the buttons list (#2392)

* Version bump (#2387)

* Minor fixes on 'filter_condition_callback' method _filterStoreCondition() (#2362)

* add ReturnTypeWillChange to various Files catched by code style checker #2302

* Phpstan fixes (#2396)

* Fixed addCrumb()

* Fixed initForm() and _needToAddDummy()

* Fixed addLink()

* Fixed addLinkRel()

* Fixed canUseCanonicalTag()

* Fixed getAddUrl...()

* Fixed rollBack() camelCase error reported by phpstan (#2403)

* Changes default root dir in composer.json (#2401)

* Fixed targetNamespace for WS-I Compliant SOAP APIs (#2405)

* Updated phpstan baseline

Co-authored-by: sv3n <[email protected]>
Co-authored-by: Fabian Blechschmidt <[email protected]>
Co-authored-by: Colin Mollenhour <[email protected]>
Co-authored-by: Kevin Jakob <[email protected]>
Co-authored-by: Ng Kiat Siong <[email protected]>
Co-authored-by: Scott Moore <[email protected]>
Co-authored-by: ADDISON <[email protected]>
Co-authored-by: Justin Beaty <[email protected]>
Co-authored-by: luigifab <[email protected]>
Co-authored-by: Daniel Fahlke <[email protected]>
Co-authored-by: leissbua <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: lib/Mage Relates to lib/Mage Component: lib/* Relates to lib/* enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants