/// <summary> /// 设置是否允许克隆 /// </summary> internal void EnableMirror() { _enableClone = true; if (MirrorStream == null) { MirrorStream = new StreamWithEventsWrapper(new MemoryStream(Math.Max((int)_streamLength, 0x1000))); } }
/// <summary> /// 设置响应流 /// </summary> /// <param name="stream"></param> internal void SetResponseStream(HttpStreamWrapper stream) { if (!HttpMonitor.RecordResponseContent || (HttpMonitor.MaxRecordContentSize > 0 && HttpMonitor.MaxRecordContentSize < stream.Length && stream.Length > 0)) { return; } stream.EnableMirror(); ResponseStream = stream.MirrorStream; }