Closed
Description
When using PHPClient
I'm always getting 426 Upgrade Required
error, when attempting to download a file from Atlassian Cloud Jira (e.g. using https://your-domain.atlassian.net/rest/api/2/attachment/content/12345 URL).
Not having this issue with CurlClient
. According to https://community.atlassian.com/t5/Jira-questions/426-Error-Upgrade-Required/qaq-p/1166653 this is related to SSL.
Returned headers:
Array
(
[0] => HTTP/1.1 426 Upgrade Required
[1] => Access-Control-Allow-Origin: *
[2] => Content-Length: 18943
[3] => Content-Type: text/html
[4] => Vary: Accept-Encoding
[5] => Server-Timing: atl-edge;dur=0,atl-edge-internal;dur=0,atl-edge-upstream;dur=0,atl-edge-pop;desc="aws-nil"
[6] => Date: Tue, 07 Jan 2025 19:45:20 GMT
[7] => Server: AtlassianEdge
[8] => Connection: close
)
The issue is solved by specifying http_version
in the stream context as 1.1
. Prior to PHP 8.0, it was 1.0
and Atlassian Cloud servers don't like that.
Prior to #147 HTTP 1.0 was enforced in the CurlClient
. Now we need to enforce HTTP 1.1 to have consistent logic across clients.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
aik099 commentedon Jan 9, 2025
Closed via #239.