(rawValue = '')
| 637 | } |
| 638 | |
| 639 | function normalizeHotmailRemoteBaseUrl(rawValue = '') { |
| 640 | const value = String(rawValue || '').trim(); |
| 641 | if (!value) return DEFAULT_HOTMAIL_REMOTE_BASE_URL; |
| 642 | |
| 643 | try { |
| 644 | const parsed = new URL(value); |
| 645 | if (!['http:', 'https:'].includes(parsed.protocol)) { |
| 646 | return DEFAULT_HOTMAIL_REMOTE_BASE_URL; |
| 647 | } |
| 648 | |
| 649 | if (parsed.pathname.endsWith('/api/mail-new') || parsed.pathname.endsWith('/api/mail-all') || parsed.pathname === '/api.html') { |
| 650 | parsed.pathname = ''; |
| 651 | parsed.search = ''; |
| 652 | parsed.hash = ''; |
| 653 | } |
| 654 | |
| 655 | return parsed.toString().replace(/\/$/, ''); |
| 656 | } catch { |
| 657 | return DEFAULT_HOTMAIL_REMOTE_BASE_URL; |
| 658 | } |
| 659 | } |
| 660 | |
| 661 | function normalizeHotmailLocalBaseUrl(rawValue = '') { |
| 662 | const value = String(rawValue || '').trim(); |
no outgoing calls
no test coverage detected