Endless loop when hostname is "dev"
See original GitHub issueCurrent behavior
When baseUrl
is set to http://dev:3000
, cypress run
hangs. Enabling DEBUG
env var shows Cypress stuck in a loop, due to incorrect parsing of hostname from URL.
In this case, dev
is incorrectly parsed as the tld
, instead of the domain
, since there is now “.” separator.
(See Debug Logs below)
Desired behavior
When baseUrl
is set to http://dev:3000
, dev
would be detected as the domain
, not a tld
and cypress run
would continue to completion.
Test code to reproduce
CYPRESS_baseUrl=http://dev:3000 cypress run
Cypress Version
11.0.1
Node version
v16.16.0
Operating System
Debian GNU/Linux 11 (bullseye)
Debug Logs
I can't include them all because it loops without end, but here was the important line:
cypress:network:cors Parsed URL { port: '3000', protocol: 'http:', subdomain: null, domain: '', tld: 'dev' } +2ms
### Other
I'm using the `cypress/included:11.0.1` Docker image
Issue Analytics
- State:
- Created 10 months ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Endless loop when hostname is "dev" · cypress-io ... - GitHub
Fast, easy and reliable testing for anything that runs in a browser. - Endless loop when hostname is "dev" · cypress-io/cypress@da7aa5d.
Read more >Redirect loop when forcing www. hostname and SSL
I'm going crazy – I just checked and rechecked my rules but I still don't understand why the server is producing a redirect...
Read more >SFTP Poller endless loop on long filename | DataPower
Hi,I'm seeing some strange behaviour at my customer with the SFTP Poller. We are running a MPGW with an SFTP Poller that polls...
Read more >ERR_TOO_MANY_REDIRECTS · Cloudflare SSL/TLS docs
This error occurs when visitors get stuck in a redirect loop.
Read more >How to Fix The ERR_TOO_MANY_REDIRECTS Error - Kinsta
The ERR_TOO_MANY_REDIRECTS error is pretty much what it sounds like: something is causing too many redirects, sending your website into an infinite redirection ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We have had a variety of issues with docker domain names / host entries that don’t have a “.” in them - Firefox also has issues parsing them out. I’m having trouble searching for the other ones, but we’ve had similar problems in the past.
The workaround is usually not too bad, as @originalhat pointed out - use a “.” somewhere in the baseUrl. Switching to an IP works; “dev.dev” probably would as well.
If someone wants to dig into this particular case more and make a PR, we’d definitely look at it.
@mjhenkes the problem is the host name is being parsed by the Public Suffix domain validator, but it has no “.” notation so it should never make it to domain validation (it’s just a local host name)
this regression was introduced sometime around 10.10+ (10.9 worked fine)