Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for follow redirect #201

Open
alee13-chwy opened this issue Aug 9, 2021 · 2 comments
Open

Add support for follow redirect #201

alee13-chwy opened this issue Aug 9, 2021 · 2 comments

Comments

@alee13-chwy
Copy link

Since 301 and 302 are considered as successful, it misses error when the final Location is an error.

Using contentInspector(result) gives me access to result.headers.location but not make a new request by setting options.path = result.headers.location

@alexfernandez
Copy link
Owner

Sorry for the inexcusable delay. I imagine it should be easier to make a request to the final location. In any case, if you propose a patch I will gladly accept it.

@JendaPerl
Copy link

I'm not sure how to make it optional, but I installed follow-redirects (npm install follow-redirects) and replaced

import * as http from 'http'
import * as https from 'https'

by

import pkg from 'follow-redirects';
const {http,https} = pkg;

in httpClient.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants