Skip to content

Magento\Framework\Filesystem\Driver\Http depends on reason phrase OK #39546

Open
@jirichmiel

Description

@jirichmiel

Summary

Method Magento\Framework\Filesystem\Driver\Http::isExists that determines whether given url exists depends on that remote server returns status header with 200 OK (e.g: HTTP/1.1 200 OK), but reason phrase OK is not required (https://www.rfc-editor.org/rfc/rfc7230#section-3.1.2). Some server may return only HTTP/1.1 200. In that case Driver\Http will tell that given url does not exist although it exists.

Examples

~$ curl -i "https://acs4.editionguard.com/fulfillment/URLLink.acsm"
HTTP/1.1 200 
Content-Type: application/vnd.adobe.adept+xml
Date: Wed, 15 Jan 2025 18:49:25 GMT
Server: Apache/2.4.39 (Amazon) OpenSSL/1.0.2k-fips
Content-Length: 139
Connection: keep-alive

Proposed solution

Change line from

return !(strpos($status, '200 OK') === false);

to

return !(strpos($status, '200') === false);

Release note

No response

Triage and priority

  • < ] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • [ > Severity: S4 - Affects aesthetics, professional look and feel, "quality" or "usability".

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: FrameworkComponent: HTTPIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneReported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    • Status

      Pull Request In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions