i am creating an HttpModule which will filter my responses for a test site to make them work with NUnitAsp. i have a prototype largely finished, but i am stuck on the proper use of a StreamWriter. the following code only copies most of the content to the sink
stream even though i have verified that content contains the full string it should. am I missing a key ingredient to force the full content string into the stream?
hlaford
Contributor
2595 Points
520 Posts
HttpModule and StreamWriter
Mar 30, 2004 10:06 PM|LINK
public override void Close() { try { string content = ExtractOutputContentFromStream(underlyingStream); new StreamWriter(sink).Write(content); } catch { underlyingStream.WriteTo(sink); } finally { sink.Close(); } base.Close(); }hlaford
Contributor
2595 Points
520 Posts
Re: HttpModule and StreamWriter
Mar 31, 2004 05:34 PM|LINK
public override void Close() { try { string content = ExtractOutputContentFromStream(underlyingStream); HttpContext.Current.Response.ClearContent(); HttpContext.Current.Response.Write(content); } catch { underlyingStream.WriteTo(sink); } finally { sink.Close(); } base.Close(); }