コミットメタ情報

リビジョン4a20a44c7341afe28c0002ed995f1785f2b215d8 (tree)
日時2018-01-27 20:47:42
作者Kazuhiro Fujieda <fujieda@user...>
コミッターKazuhiro Fujieda

ログメッセージ

エラーログのレスポンスからapi_resultを取り除くのをやめる

変更サマリ

差分

--- a/KancolleSniffer.Test/ErrorLogTest.cs
+++ b/KancolleSniffer.Test/ErrorLogTest.cs
@@ -43,14 +43,13 @@ namespace KancolleSniffer.Test
4343 public void RemoveUnwantedInformationFromResponse()
4444 {
4545 var request = "";
46- var response = @"{""api_result"":1,""api_result_msg"":""成功"",""api_data"":"+
47- @"{""api_basic"":{""api_member_id"":""123456""," +
48- @"""api_nickname"":""ぱんなこった"",""api_nickname_id"":""12345678"",""api_active_flag"":1}}}";
46+ var response = @"{""api_result"":1,""api_result_msg"":""成功"",""api_data"":" +
47+ @"{""api_basic"":{""api_member_id"":""123456""," +
48+ @"""api_nickname"":""ぱんなこった"",""api_nickname_id"":""12345678"",""api_active_flag"":1}}}";
4949 ErrorLog.RemoveUnwantedInformation(ref request, ref response);
50- PAssert.That(() => response == @"{""api_basic"":{""api_active_flag"":1}}");
51- var response2 = @"{""api_result"":1,""api_result_msg"":""成功""}";
52- ErrorLog.RemoveUnwantedInformation(ref request, ref response2);
53- PAssert.That(() => response2 == @"");
50+ PAssert.That(() => response ==
51+ @"{""api_result"":1,""api_result_msg"":""成功"",""api_data"":" +
52+ @"{""api_basic"":{""api_active_flag"":1}}}");
5453 }
5554 }
5655 }
\ No newline at end of file
--- a/KancolleSniffer/ErrorLog.cs
+++ b/KancolleSniffer/ErrorLog.cs
@@ -114,8 +114,6 @@ namespace KancolleSniffer
114114 request = token.Replace(request, "");
115115 var id = new Regex(@"""api_member_id"":""\d+?"",?|""api_nickname"":"".+?"",?|""api_nickname_id"":""\d+"",?");
116116 response = id.Replace(response, "");
117- var preamble = new Regex(@"^{""api_result"":.+?({.*})?}$");
118- response = preamble.Replace(response, match => match.Groups[1].Value);
119117 }
120118
121119 private string CompressApi(string api)
旧リポジトリブラウザで表示