(host: string)
| 36 | |
| 37 | // Checks if the routing is subdomain or based on paths |
| 38 | export const isSubdomainbasedRouting = (host: string): boolean => { |
| 39 | if (host.includes('vercel.app')) { |
| 40 | return false; |
| 41 | } |
| 42 | if (host.includes('linendev.com')) { |
| 43 | return false; |
| 44 | } |
| 45 | if (host.includes('www.localhost:3000')) { |
| 46 | return false; |
| 47 | } |
| 48 | |
| 49 | if (host.includes('.')) { |
| 50 | const splitHost = host.split('.'); |
| 51 | if (splitHost[0] === 'www') { |
| 52 | // for cases where user want to use fully qualified name and not subdomain like www.papercups.io |
| 53 | if (splitHost[1] !== 'linen') { |
| 54 | return true; |
| 55 | } |
| 56 | return false; |
| 57 | } |
| 58 | if (host.includes('localhost:3000')) { |
| 59 | return true; |
| 60 | } |
| 61 | |
| 62 | // handle osquery.fleetdm.com and something.linen.dev |
| 63 | if (host.split('.').length > 2) { |
| 64 | return true; |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | return false; |
| 69 | }; |
| 70 | |
| 71 | export function isSubdomainNotAllowed(host: string) { |
| 72 | return ( |
no outgoing calls
no test coverage detected