From 4d39b1e4e3d21b7858caee272d193c4a31f07890 Mon Sep 17 00:00:00 2001 From: terwer Date: Fri, 29 Nov 2024 15:51:41 +0800 Subject: [PATCH] fix: #504 use https as api protocol --- libs/Universal-PicGo-Core/src/plugins/uploader/imgur.ts | 2 +- libs/Universal-PicGo-Core/src/plugins/uploader/qiniu/index.ts | 2 +- libs/Universal-PicGo-Core/src/plugins/uploader/tcyun.ts | 4 ++-- libs/Universal-PicGo-Core/src/plugins/uploader/upyun/index.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/Universal-PicGo-Core/src/plugins/uploader/imgur.ts b/libs/Universal-PicGo-Core/src/plugins/uploader/imgur.ts index b496a4b1..e8e3e462 100644 --- a/libs/Universal-PicGo-Core/src/plugins/uploader/imgur.ts +++ b/libs/Universal-PicGo-Core/src/plugins/uploader/imgur.ts @@ -69,7 +69,7 @@ const handle = async (ctx: IPicGo): Promise => { ctx.emit(IBuildInEvent.NOTIFICATION, { title: ctx.i18n.translate("UPLOAD_FAILED"), body: ctx.i18n.translate("CHECK_SETTINGS_AND_NETWORK"), - text: "http://docs.imgur.com/api/errno/", + text: "https://docs.imgur.com/api/errno/", }) if (e?.statusCode) { errMsg = e.response?.body?.data.error ?? e.response?.body?.data ?? e.stack ?? "unknown error" diff --git a/libs/Universal-PicGo-Core/src/plugins/uploader/qiniu/index.ts b/libs/Universal-PicGo-Core/src/plugins/uploader/qiniu/index.ts index 672c9faa..4587f9e3 100644 --- a/libs/Universal-PicGo-Core/src/plugins/uploader/qiniu/index.ts +++ b/libs/Universal-PicGo-Core/src/plugins/uploader/qiniu/index.ts @@ -26,7 +26,7 @@ function postOptions(options: IQiniuConfig, fileName: string, token: string, img .replace(/\//g, "_") return { method: "POST", - url: `http://upload${area}.qiniup.com/putb64/-1/key/${base64FileName}`, + url: `https://upload${area}.qiniup.com/putb64/-1/key/${base64FileName}`, headers: { Authorization: `UpToken ${token}`, "Content-Type": mime.lookup(fileName) || "application/octet-stream", diff --git a/libs/Universal-PicGo-Core/src/plugins/uploader/tcyun.ts b/libs/Universal-PicGo-Core/src/plugins/uploader/tcyun.ts index e23dd917..983078d6 100644 --- a/libs/Universal-PicGo-Core/src/plugins/uploader/tcyun.ts +++ b/libs/Universal-PicGo-Core/src/plugins/uploader/tcyun.ts @@ -73,7 +73,7 @@ const postOptions = ( if (!options.version || options.version === "v4") { return { method: "POST", - url: `http://${area}.file.myqcloud.com/files/v2/${signature.appId}/${signature.bucket}/${encodeURI( + url: `https://${area}.file.myqcloud.com/files/v2/${signature.appId}/${signature.bucket}/${encodeURI( path )}${fileName}`, headers: { @@ -92,7 +92,7 @@ const postOptions = ( } else { return { method: "PUT", - url: `http://${options.bucket}.cos.${options.area}.myqcloud.com/${encodeURIComponent(path)}${encodeURIComponent( + url: `https://${options.bucket}.cos.${options.area}.myqcloud.com/${encodeURIComponent(path)}${encodeURIComponent( fileName )}`, headers: { diff --git a/libs/Universal-PicGo-Core/src/plugins/uploader/upyun/index.ts b/libs/Universal-PicGo-Core/src/plugins/uploader/upyun/index.ts index 1a22ceaf..818874c6 100644 --- a/libs/Universal-PicGo-Core/src/plugins/uploader/upyun/index.ts +++ b/libs/Universal-PicGo-Core/src/plugins/uploader/upyun/index.ts @@ -84,7 +84,7 @@ const postOptions = (options: IUpyunConfig, fileName: string, saveKey: string, i return { method: "POST", - url: `http://v0.api.upyun.com/${options.bucket}`, + url: `https://v0.api.upyun.com/${options.bucket}`, headers: { // multipart/form-data 是自动设置的,这里不需要 // "Content-Type": "multipart/form-data",