HubSpot / offline

Automatically display online/offline indication to your users

Home Page:http://github.hubspot.com/offline/docs/welcome

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong status when user's internet is down but ISP redirects to their website

laxx opened this issue · comments

commented

Great job on this plugin I must first say. I have a slight issue when using this plugin to check if internet connection is on with users whose ISPs usually redirect them to their website when their subscription expires or something similar. So instead of the traditional browser error "could not connect to the internet", the user is redirected to an actual page which most times is the homepage of the ISP. This in turn makes Offline think the user still has internet connectivity because of the 202 status code when in reality they cannot browse any other pages (for instance my API endpoints) aside from those on the ISP's server. Is there an option to tell Offline to look for a more descriptive message instead of just the status code?

This is quite common with "guest" connections, e.g. in hotels or restaurants.

The issue with "captive portals" is that there is no standardized way to announce this redirect. What you could do is make a HTTPS request - if that fails, either the network is down, or the ISP is redirecting to their captive portal (and thus the encryption should fail).