Skip to content

Commit 22cf0c7

Browse files
authored
Merge pull request #3 from aliyun/danieldev
support skip response validation
2 parents 71762d7 + aafce04 commit 22cf0c7

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

sdk/Aliyun/OTS/Handler/HttpHeaderHandler.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,13 @@ private void CheckAuthorization(Context context)
200200
public override void HandleAfter(Context context)
201201
{
202202
InnerHandler.HandleAfter(context);
203-
203+
204+
// Disable reponse validation
205+
if (context.ClientConfig.SkipResponseValidation)
206+
{
207+
return;
208+
}
209+
204210
try
205211
{
206212
CheckOtherHeaders(context);

sdk/Aliyun/OTS/OTSClientConfig.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ public string UserAgent
8282
/// </summary>
8383
public OTSLogHandler OTSDebugLogHandler { get; set; }
8484

85+
/// <summary>
86+
/// 跳过返回校验
87+
/// </summary>
88+
public bool SkipResponseValidation { get; set; }
89+
8590
/// <summary>
8691
/// OTSClientConfig的构造函数。
8792
/// </summary>
@@ -110,7 +115,7 @@ public OTSClientConfig(string endPoint, string accessKeyID, string accessKeySecr
110115
ConnectionLimit = DefaultConnectionLimit;
111116
APIVersion = DefaultAPIVersion;
112117
RetryPolicy = RetryPolicy.DefaultRetryPolicy;
113-
118+
114119
OTSErrorLogHandler = OTSDefaultLogHandler.DefaultErrorLogHandler;
115120
OTSDebugLogHandler = OTSDefaultLogHandler.DefaultDebugLogHandler;
116121
}

0 commit comments

Comments
 (0)