Skip to content
This repository has been archived by the owner on Jun 12, 2022. It is now read-only.

fix(redirect): handle redirects explicitly #27

Merged
merged 6 commits into from
May 22, 2017
Merged

Conversation

nlkluth
Copy link
Contributor

@nlkluth nlkluth commented May 22, 2017

Fixes #26

Copy link
Owner

@zkat zkat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really great! Thank you!

Only one small change request involving the errors themselves, but the lest looks great, is super thorough, and I love the tests. They covered pretty much anything I was keeping an eye out for. 👏🏼

index.js Outdated
}

if (req.counter >= req.follow) {
throw new Error(`maximum redirect reached at: ${uri}`, 'max-redirect')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this second argument do? The convention so far has been to use a code property on error objects to have single codes that people can use.

Copy link
Contributor Author

@nlkluth nlkluth May 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, this is my mistake. I'll get the change going thanks! Are there a set of codes to go off of?

Copy link
Owner

@zkat zkat May 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah. My main suggestion would be to use the convention I've been using for other libraries, so E<SOMECODE> in uppercase. Unix-style.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave it a go - but happy to make changes :)

@zkat
Copy link
Owner

zkat commented May 22, 2017

💃

@zkat zkat merged commit 4c4af54 into zkat:latest May 22, 2017
@zkat
Copy link
Owner

zkat commented May 23, 2017

This has been released as part of 2.4.4. Thanks so much for this. It's awesome work, and incredibly helpful, and I really appreciate your time <3

@nlkluth
Copy link
Contributor Author

nlkluth commented May 23, 2017

Thanks! 🙌

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

Successfully merging this pull request may close these issues.

3 participants