-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Component: Framework/HTTPIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passed
Description
Preconditions (*)
- Magento version 2.2.6
- a version of Curl that supports HTTP/2 (v 7.43.0 or above)
- (optional) CentOS operating system
Steps to reproduce (*)
- Make an api request using ZendClient and the Curl adapter to an API endpoint that returns an HTTP/2 response
- Receive the error "Invalid header line detected"
Expected result (*)
- The api response to be returned successfully without throwing an exception
Actual result (*)
- An exception is thrown because the HTTP/2 header format cannot be parsed.
Solution
- Alter the regex in Zend_Http_Response, function extractHeaders to properly validate HTTP/2
- Line 517:
if ($index === 0 && preg_match('#^HTTP/\d+(?:\.\d+) [1-5]\d+#', $line)) {
is where string "HTTP/2 200" breaks. The regex should optionally enforce the period since 2.0 was dropped from HTTP/2. Sample fixed regex: '#^HTTP/\d+(?:.\d+)? [1-5]\d+#'
Metadata
Metadata
Assignees
Labels
Component: Framework/HTTPIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passed