From cc784cdd3805362653db055fb4b3b77b8f5fef68 Mon Sep 17 00:00:00 2001 From: xpnas Date: Sat, 8 Jan 2022 01:24:39 +0800 Subject: [PATCH] fix bug --- Inotify/Controllers/SettingController.cs | 3 --- Inotify/Sends/SendTemplate.cs | 7 +++++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Inotify/Controllers/SettingController.cs b/Inotify/Controllers/SettingController.cs index 5494075..71b8b5b 100644 --- a/Inotify/Controllers/SettingController.cs +++ b/Inotify/Controllers/SettingController.cs @@ -49,9 +49,6 @@ namespace Inotify.Controllers sendTemplate.IsActive = sendAuthInfo.Active; sendTemplate.AuthToTemplate(sendAuthInfo.AuthData); userSendTemplates.Add(sendTemplate); - } - if (barkTemplateAttribute.Key == sendTemplate.Type) - { sendTemplate.Values.FirstOrDefault(e => e.Name == nameof(BarkSendTemplate.Auth.SendUrl)).Value = ""; } } diff --git a/Inotify/Sends/SendTemplate.cs b/Inotify/Sends/SendTemplate.cs index 54f1b94..c7b0217 100644 --- a/Inotify/Sends/SendTemplate.cs +++ b/Inotify/Sends/SendTemplate.cs @@ -237,8 +237,11 @@ namespace Inotify.Sends { if (IsUrl(url) && IsImage(url)) { - WebClient mywebclient = new WebClient(); - return mywebclient.DownloadData(url); + using (WebClient mywebclient = new WebClient()) + { + return mywebclient.DownloadData(url); + } + } return null; }