fix: docker packages and IP parsing for 127.0.0.1
This commit is contained in:
@@ -11,6 +11,13 @@ export type View = 'home' | 'login' | 'history' | 'jump-game' | 'flappy-game';
|
||||
|
||||
const getSubdomain = () => {
|
||||
const hostname = window.location.hostname;
|
||||
// Handle localhost and 127.0.0.1 cases.
|
||||
// For more advanced cases (like bare IP hosting)
|
||||
// a regex may be necessary.
|
||||
if (hostname === 'localhost' || hostname === '127.0.0.1') {
|
||||
return null;
|
||||
}
|
||||
|
||||
const parts = hostname.split('.');
|
||||
if (parts.length <= 2) return null;
|
||||
return parts[0];
|
||||
|
||||
Reference in New Issue
Block a user