http-client icon indicating copy to clipboard operation
http-client copied to clipboard

Http client not able to redirect

Open divyansh42 opened this issue 3 years ago • 0 comments

I am using this in one of our actions but I noticed that HTTP client is not able to redirect to the updated URL. Below is the output of the curl command which has a location header that points to the relative URL.

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

When using this HTTP client it tries to hit /pub/openshift-v4/x86_64/clients/serverless/0.15.2/ which is an incomplete and invalid URL. The problem that I see here is - it is not able to resolve relative URL.

As per my understanding HTTP client does this automatically. If not, please guide me accordingly.

divyansh42 avatar Dec 17 '21 14:12 divyansh42