axios+telemetry cleanup
This commit is contained in:
@@ -6,6 +6,7 @@ import { isRunningWithBun } from './bundledMode.js'
|
||||
import { getClaudeConfigHomeDir, isEnvTruthy } from './envUtils.js'
|
||||
import { findExecutable } from './findExecutable.js'
|
||||
import { getFsImplementation } from './fsOperations.js'
|
||||
import { nativeRequest } from './http.js'
|
||||
import { which } from './which.js'
|
||||
|
||||
type Platform = 'win32' | 'darwin' | 'linux'
|
||||
@@ -27,9 +28,10 @@ export const getGlobalClaudeFile = memoize((): string => {
|
||||
|
||||
const hasInternetAccess = memoize(async (): Promise<boolean> => {
|
||||
try {
|
||||
const { default: axiosClient } = await import('axios')
|
||||
await axiosClient.head('http://1.1.1.1', {
|
||||
signal: AbortSignal.timeout(1000),
|
||||
await nativeRequest('http://1.1.1.1', {
|
||||
method: 'HEAD',
|
||||
timeout: 1000,
|
||||
responseType: 'none',
|
||||
})
|
||||
return true
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user