actions / http-client

A lightweight HTTP client optimized for use with actions, TypeScript with generics and async await.
https://github.com/features/actions
Other
72 stars 33 forks source link

Http client not able to redirect #62

Open divyansh42 opened 2 years ago

divyansh42 commented 2 years ago

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.