TL;DR: if you're using Mirage in production, add
this.passthrough('http://localhost:0/chromecheckurl') to your
I was building a small website the other weekend, and opted to use Mirage (
ember-cli-mirage) fixtures to stub static data at adapter-friendly "endpoints".
All seemed fine when testing in development, so I enabled Mirage for production environments per the docs and deployed to the live server. Most browsers continued to check out, but I was greeted to an alarming screen when testing in Chrome for iOS. It looked something like this:
Warning: Something's Not Right Here! Chrome is unable to verify that the URL for this site is correct. UNVERIFIED URL
Some digging exposed that Chrome for iOS introduces this small, very fixable bug when a particular outbound request is intercepted.
- Chrome for iOS uses a local endpoint (
http://localhost:0/chromecheckurl) to circumvent Webkit's limitations and verify URLs, for authenticity & safety & other voodoo magic;
- Mirage intercepts outbound traffic (via Pretender);
- Chrome cannot reach its
localhost:0endpoint to verify the URL; so
- Chrome spits a big ugly error :(
To resolve this issue, simply configure Mirage & Pretender to permit outbound requests to
http://localhost:0/chromecheckurl, then redeploy.
Addendum: if you're having trouble using Passthrough with Mirage, try upgrading to
pretender >= 0.11.0 ||
jquery >=2.1.0. There was a known issue with Pretender's passthrough strategy in much of the
jQuery 1.x series which was only recently resolved.