cherry-studio/src/main/utils
beyondkmp 4a62bb6ad7
refactor: replace axios and node fetch with electron's net module (#9212)
* refactor: replace axios and node fetch with electron's net module for network requests in preprocess providers

- Updated Doc2xPreprocessProvider and MineruPreprocessProvider to use net.fetch instead of axios for making HTTP requests.
- Improved error handling for network responses across various methods.
- Removed unnecessary AxiosRequestConfig and related code to streamline the implementation.

* lint

* refactor(Doc2xPreprocessProvider): enhance file validation and upload process

- Added file size validation to prevent loading files larger than 300MB into memory.
- Implemented file size check before reading the PDF to ensure efficient memory usage.
- Updated the file upload method to use a stream, setting the 'Content-Length' header for better handling of large files.

* refactor(brave-search): update net.fetch calls to use url.toString()

- Modified all instances of net.fetch to use url.toString() for better URL handling.
- Ensured consistency in how URLs are passed to the fetch method across various functions.

* refactor(MCPService): improve URL handling in net.fetch calls

- Updated net.fetch to use url.toString() for better type handling of URLs.
- Ensured consistent URL processing across the MCPService class.

* feat(ProxyManager): integrate axios with fetch proxy support

- Added axios as a dependency to enable fetch proxy usage.
- Implemented logic to set axios's adapter to 'fetch' for proxy handling.
- Preserved original axios adapter for restoration when disabling the proxy.
2025-08-15 22:48:22 +08:00
..
__tests__ fix: change jschardet to chardet (#8577) 2025-07-29 17:27:36 +08:00
aes.ts feat: add aihubmix oauth 2025-02-07 22:27:28 +08:00
file.ts fix: change jschardet to chardet (#8577) 2025-07-29 17:27:36 +08:00
index.ts feat: add code tools (#9043) 2025-08-12 11:54:38 +08:00
init.ts refactor: move initAppDataDir function to a new utils module (#8337) 2025-07-21 15:46:14 +08:00
ipService.ts refactor: replace axios and node fetch with electron's net module (#9212) 2025-08-15 22:48:22 +08:00
locales.ts chore(i18n): forced nested structure to support i18n ally (#8457) 2025-07-25 17:36:04 +08:00
mcp.ts refactor: improve sanitization and formatting in buildFunctionCallToo… (#6152) 2025-05-19 11:20:38 +08:00
process.ts refactor: Unified Logger / 统一日志管理 (#8207) 2025-07-18 09:40:56 +08:00
systemInfo.ts feat(AppUpdater): integrate User-Agent generation for autoUpdater req… (#7751) 2025-07-02 16:18:44 +08:00
windowUtil.ts fix: font-family changed in Windows with new Electron (#6079) 2025-05-17 21:27:29 +08:00
zip.ts refactor[Logger]: strict type check for Logger (#8363) 2025-07-23 13:24:03 +08:00
zoom.ts style: set eol to lf, code formatting (#7923) 2025-07-08 09:50:33 +08:00