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

Gracefully handle invalid Location redirect URLs #605

Merged
merged 2 commits into from Sep 8, 2018

Conversation

brandon93s
Copy link
Contributor

  • Move new URL into existing try...catch block to gracefully handle failures
  • Add test for ERR_INVALID_URL

h/t to @alextes for his initial research.


Closes #604

@alextes
Copy link
Contributor

alextes commented Sep 8, 2018

Nice work Brandon93. Lots of little improvements over what I wrote too. Unfortunately it does still suffer from the issue I flagged with the test. This test, like mine, is half functional. It lights up green beautifully, but imagine someone refactors and moves the new URL line out of the try/catch , the test won't show up red 😥 . It'll hang ava indefinitely which is something, but if possible I'd like the test red.

Let's see if the other maintainers have an idea of how to fix it, if not, let's merge this and open an issue.

To reproduce try moving the line back out of the try/catch construct.

@szmarczak
Copy link
Collaborator

To reproduce try moving the line back out of the try/catch construct.

So don't move that. :>

@szmarczak szmarczak merged commit 7ae6939 into sindresorhus:master Sep 8, 2018
@alextes
Copy link
Contributor

alextes commented Sep 8, 2018

🙈

@brandon93s
Copy link
Contributor Author

See avajs/ava#1931 for related issue.

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.

None yet

3 participants