チェンジセット 1677 (default)
- 日時:
- 2024/08/30 16:36:30 (5週前)
- ファイル:
-
- 1個の更新
凡例:
- 未変更
- 追加
- 削除
-
framework/trunk/WebLibrary/Sources/WebDebugging.cs
r1234 r1677 183 183 184 184 // リクエスト情報 185 string remotePort = request.ServerVariables["REMOTE_PORT"];186 185 builder.Append(Resources.Log_Web_WebDebugging_RequestRawUrlKey, request.RawUrl); 187 186 builder.Append(Resources.Log_Web_WebDebugging_RequestRequestTypeKey, request.RequestType); 188 builder.Append( 189 Resources.Log_Web_WebDebugging_RequestUserHostKey, 190 !string.IsNullOrEmpty(remotePort) ? request.UserHostAddress + ":" + remotePort : request.UserHostAddress); 187 builder.Append(Resources.Log_Web_WebDebugging_RequestUserHostKey, GetRequestUserHost(request)); 191 188 192 189 if (string.Equals(request.RequestType, "POST", StringComparison.OrdinalIgnoreCase)) … … 710 707 711 708 /// <summary> 709 /// リクエスト元のホスト情報を取得します。 710 /// </summary> 711 /// <param name="request">HTTP リクエスト。</param> 712 /// <returns> 713 /// リクエスト元のホスト情報。 714 /// </returns> 715 private static string GetRequestUserHost(HttpRequest request) 716 { 717 // Proxy 経由で情報が提供されている場合 718 string forwardedFor = request.Headers["X-Forwarded-For"]; 719 if (forwardedFor != null) 720 { 721 return forwardedFor; 722 } 723 724 string userHost = request.UserHostAddress; 725 string remotePort = request.ServerVariables["REMOTE_PORT"]; 726 return !string.IsNullOrEmpty(remotePort) 727 ? userHost + ":" + remotePort 728 : userHost; 729 } 730 731 /// <summary> 712 732 /// <see cref="MaxDumpValueLength"/> の値を初期化します。 713 733 /// </summary>
※ 詳しい使い方は
TracChangeset を参照してください。