Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for localhost vs IP cypress testing issue (#12)
Well this was an odd one... The React frontend could interact with the Python backend using localhost when the Analyze button was click. Cypress performing the same button click did not trigger a call to the Python API. My initial fix was changing the url invoked by the button click to `127.0.0.1` instead of `localhost`, but the IP didn't sit right with me. I tried several other fixes, but [enabling `ipv4first`](cypress-io/cypress#25397 (comment)) is the only one that worked. This is due to a fairly recent change to NodeJS documented [here](https://nodejs.org/api/dns.html#dnssetdefaultresultorderorder) and further explained [here](https://nodejs.org/api/dns.html#dnslookuphostname-options-callback) as setting `verbatim` to false in dns lookup, which prioritized ipv4 addresses over ipv6: > verbatim [<boolean>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Boolean_type) When true, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When false, IPv4 addresses are placed before IPv6 addresses. Default: true (addresses are not reordered).
- Loading branch information