-
-
Notifications
You must be signed in to change notification settings - Fork 27
fix(redirect): handle redirects explicitly #27
Conversation
There was a problem hiding this 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') |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 :)
💃 |
This has been released as part of |
Thanks! 🙌 |
Fixes #26