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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP-redirect #100

Closed
wants to merge 2 commits into from
Closed

HTTP-redirect #100

wants to merge 2 commits into from

Conversation

savi2w
Copy link

@savi2w savi2w commented Apr 25, 2020

Overview

This PR implements a HTTP-redirect

In Node side:

In Browser side:

  • The redirect value is passed to fetch options 馃榾

Interface

const getJSON = bent("json");

getJSON.redirect = "follow"; // manual, *follow, error

"manual" has no effect on Node side

Closes #87

@mikeal
Copy link
Owner

mikeal commented Apr 27, 2020

There鈥檚 too many white space changes for me to read the diff properly 鈽癸笍

@rwilson-release
Copy link

There鈥檚 too many white space changes for me to read the diff properly 鈽癸笍

@mikeal You can disable whitespace diff and the PR is quite readable. This is a new feature I believe.
image

@savi2w
Copy link
Author

savi2w commented Nov 20, 2020

I'm not interested in pursuing this PR anymore

@savi2w savi2w closed this Nov 20, 2020
@savi2w savi2w deleted the follow-redirect branch November 20, 2020 18:06
@VisiontechGitHub
Copy link

@mikeal ...

@mikeal
Copy link
Owner

mikeal commented Nov 20, 2020

If someone wants to clean it up and resubmit it then I鈥檒l review it.

I鈥檓 quite busy and don鈥檛 have to the time to clean up the whitespace is other people鈥檚 patches.

@willpower232
Copy link

FWIW this PR just helped me debug where I was going wrong in a node package.

The whitespace change is necessary to maintain the indentation as the mkrequest method must essentially call itself again from within itself to follow the redirect manually. This means that the return of mkrequest needs to be captured before it is returned to provide this.

Unless you'd be happy with this line of code to avoid all the indentation changes

const mkrequest = (statusCodes, method, encoding, headers, baseurl) => { const rep = (_url, body = null, _headers = {}, redirLength = 0) => {

I'd gladly resubmit this PR either way but clarification would be handy first 馃槄

@Orel-A
Copy link

Orel-A commented May 4, 2024

I'm not interested in pursuing this PR anymore

Can you recommend a different library that supports redirects?

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

Successfully merging this pull request may close these issues.

Support limit of redirects
6 participants