From 8cec65b0a7187bc53ce63331d3d21f15429a68ba Mon Sep 17 00:00:00 2001 From: topjohncian <45138629+topjohncian@users.noreply.github.com> Date: Sat, 15 Oct 2022 09:06:12 +0800 Subject: [PATCH] Fix: cannot finish callback when uploading an office file using sharepoint.cn (#1503) --- service/callback/upload.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/callback/upload.go b/service/callback/upload.go index 7c8aeef..0dd7924 100644 --- a/service/callback/upload.go +++ b/service/callback/upload.go @@ -175,7 +175,7 @@ func (service *OneDriveCallback) PreProcess(c *gin.Context) serializer.Response // SharePoint 会对 Office 文档增加 meta data 导致文件大小不一致,这里增加 1 MB 宽容 // See: https://github.com/OneDrive/onedrive-api-docs/issues/935 - if strings.Contains(fs.Policy.OptionsSerialized.OdDriver, "sharepoint.com") && isSizeCheckFailed && (info.Size > uploadSession.Size) && (info.Size-uploadSession.Size <= 1048576) { + if (strings.Contains(fs.Policy.OptionsSerialized.OdDriver, "sharepoint.com") || strings.Contains(fs.Policy.OptionsSerialized.OdDriver, "sharepoint.cn")) && isSizeCheckFailed && (info.Size > uploadSession.Size) && (info.Size-uploadSession.Size <= 1048576) { isSizeCheckFailed = false }