XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEExtension.NetCore.ServerInteractive

[DLL] Server interaction extension, including user identity verification and querying in conjunction with AutoConfig

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFEExtension.NetCore.ServerInteractive

支持自动对服务器响应进行 Unescape 处理

在 XFEClientRequester 中增加 AutoUnescapeResponse 选项,允许在处理服务器响应时自动执行 Regex.Unescape;并为此引入了 System.Text.RegularExpressions 引用。这样可自动还原服务器返回的转义字符串。

255d7b4
XFE工作室室长 <mail@xfegzs.com>
提交于

代码差异

1 个文件 +3 -0
Modified XFEExtension.NetCore.ServerInteractive/Utilities/Requester/XFEClientRequester.cs +3 -0
@@ -1,5 +1,6 @@
1 1 using System.Net;
2 2 using System.Text.Json;
3 using System.Text.RegularExpressions;
3 4 using XFEExtension.NetCore.AutoImplement;
4 5 using XFEExtension.NetCore.DelegateExtension;
5 6 using XFEExtension.NetCore.ServerInteractive.Exceptions;
@@ -88,6 +89,8 @@ public abstract class XFEClientRequester : IRequesterBase
88 89 {
89 90 var (response, code) = await InteractiveHelper.GetServerResponse(RequestAddress, instance.ConstructBody(Session, ComputerInfo, parameters), _jsonSerializerOptions);
90 91 result.StatusCode = code;
92 if (AutoUnescapeResponse)
93 response = Regex.Unescape(response);
91 94 if (code == HttpStatusCode.OK)
92 95 {
93 96 var requestResult = instance.ProcessResponse?.Invoke(response);