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

[Feature] blacklistHosts should return failed or similar #5084

Closed
CSchulz opened this issue Sep 4, 2019 · 3 comments
Closed

[Feature] blacklistHosts should return failed or similar #5084

CSchulz opened this issue Sep 4, 2019 · 3 comments

Comments

@CSchulz
Copy link

CSchulz commented Sep 4, 2019

Current behavior:

The current implementation of the blacklistHosts returns a 503 service unavailable error. For some scripts this leads to unexpected errors f.e. they are crashing completely.

see

return res.status(503).end()

Screenshot of Chrome ran by cypress:
Screenshot of Chrome ran by cypress

Desired behavior:

The blacklistHosts implementation should return a failed or similar error like the DNS is not resolvable.

Screenshot of Chrome with failing DNS resolution:
Screenshot of Chrome

Versions

3.4.1

@jennifer-shehane
Copy link
Member

There doesn't seem to be any documented conversation on why this decision was initially made: #442 (comment)

For some scripts this leads to unexpected errors f.e. they are crashing completely.

Can you explain more fully by what you mean?

I kind of feel like any implementation we choose is going to go down some avenue of 'not truly representing what we want'. But I'll bring it up with engineering.

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Sep 9, 2019
@CSchulz
Copy link
Author

CSchulz commented Sep 13, 2019

In our case it is an external tracking script written by Adobe, it handles connection failed errors but no server errors.

Most scripts are checking if the return code is not equal to 0, if so they continue. If the return code equals 0, you know the connection failed.

@flotwig
Copy link
Contributor

flotwig commented Sep 13, 2019

Hey @CSchulz, when #687 is complete, it will allow you to end requests with a network error by doing something like this:

// force all requests to `tracking.adobe.com` to end early
cy.route({ domain: 'tracking.adobe.com' }).end()

So since this will make the requested behavior possible, I'm closing this issue.

@flotwig flotwig closed this as completed Sep 13, 2019
@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Sep 16, 2019
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