Closed divyansh42 closed 2 years ago
The other option is to see redirect is supported in the client and explicitly turn it on.
Redirect is automatically done in http client that we are using but the redirect link provided in the Location header is not complete due to which redirect is not working,
curl -i https://mirror.openshift.com/pub/openshift-v4/clients/serverless/0.15.2
HTTP/2 302
content-type: application/xml
content-length: 0
date: Thu, 16 Dec 2021 05:31:27 GMT
server: AmazonS3
location: /pub/openshift-v4/x86_64/clients/serverless/0.15.2/
x-cache: Hit from cloudfront
via: 1.1 43ea48c3f6365b58e0e610399bbffb41.cloudfront.net (CloudFront)
x-amz-cf-pop: TLV50-C2
x-amz-cf-id: AC4rnmBJu0hduPCGN4Mlkvw4CjjVC9jBIm1WnQDTZskQSRVAms2tAA==
age: 29022
So we can discuss this with the OpenShift mirror team if they can provide us with the complete URL in the location header.
Just out of curiousity I looked up the RFC for redirects and relative Location
URLs are allowed.
So technically the mirror is follow the spec correctly and this should be considered a bug in the actions HTTP client that it's not resolving the relative URL to an absolute one. This is not surprising because curl and the browser correctly handle this redirect.
https://www.rfc-editor.org/rfc/rfc7231#section-7.1.2 https://www.rfc-editor.org/rfc/rfc3986#section-5.4
@tetchel thanks for the pointers. I wasn't aware of this. I will open a bug in the HTTP client.
Signed-off-by: divyansh42 diagrawa@redhat.com
Description
After OpenShift Mirror was redirected to the newer OpenShift Mirror (mirror2), this action started failing as it was not able to redirect. This PR includes fix for that.
Related Issue(s)
58
Checklist
[x] This PR does not need a documentation change
[x] This PR's changes are already tested
Changes made
/
at the end of the URL, as I found this workaround during triage. There might be a better way to do that, but to quickly provide a fix we can stick to this and later change if required.CRC
data that we parse to get the available version, handled that case too in this PR.