fix: normalize url

This commit is contained in:
Han Xiao 2025-03-17 14:44:28 +08:00
parent 5c36410b54
commit 01705291c4
2 changed files with 4 additions and 1 deletions

View File

@ -21,6 +21,7 @@ export function readUrl(url: string, withAllLinks?: boolean, tracker?: TokenTrac
'Content-Type': 'application/json',
'X-Retain-Images': 'none',
'X-Md-Link-Style': 'discarded',
'X-Engine': 'direct'
};
if (withAllLinks) {
headers['X-With-Links-Summary'] = 'all'

View File

@ -466,7 +466,9 @@ export async function processURLs(
(error?.name === 'ParamValidationError' && error.message?.includes('Domain')) ||
(error?.name === 'AssertionFailureError' && error.message?.includes('resolve host name')) ||
error?.message?.includes("Couldn't resolve host name") ||
error?.message?.includes("could not be resolved")
error?.message?.includes("could not be resolved") ||
error?.message?.includes("ERR_CERT_COMMON_NAME_INVALID") ||
error?.message?.includes("ERR_CONNECTION_REFUSED")
) {
let hostname = '';
try {