Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/main/lib/ipcEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { debouncer, getAccountUID, getPageFromQuery, isDev } from '@shared/utils
import { NetworkController } from '@/classes/controllers/NetworkController'
import { useLogin } from '@shared/useLogin'
import { PhoneIslandWindow } from '@/classes/windows'
import { ClientRequest, get } from 'http'
import { ClientRequest, get as httpGet } from 'http'
import { get as httpsGet } from 'https'
import os from 'os'
import {
CommandBarDoubleTapModifier,
Expand Down Expand Up @@ -113,10 +114,13 @@ export function registerIpcEvents() {
}
}
try {
const request = get(
const isHttps = url.startsWith('https')
const doGet = isHttps ? httpsGet : httpGet
const request = doGet(
url,
{
timeout: 3000
timeout: 3000,
...(isHttps && { rejectUnauthorized: false })
},
(res) => {
if (res.statusCode !== 200) {
Expand Down