https://bugzilla.novell.com/show_bug.cgi?id=343915
Summary: HttpListenerResponse - exception when changing
contenttype
Product: Mono: Class Libraries
Version: 1.2.5
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: CORLIB
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
QAContact: [EMAIL PROTECTED]
Found By: ---
When using a System.Net.HttpListener, the following code fails to run. MS.NET
prints out the correct content type. This was found under .NET 2.0.
Sample app:
using System;
using System.Net;
namespace TCP
{
class Program
{
static void Main(string[] args)
{
string location = string.Format("http://{0}:{1}/",
IPAddress.Loopback.ToString(), 10000);
HttpListener listener = new HttpListener();
listener.Prefixes.Add(location);
listener.Start();
IAsyncResult listenerResult = listener.BeginGetContext(null, null);
WebRequest webRequest = WebRequest.Create(location);
IAsyncResult requestResult = webRequest.BeginGetResponse(null,
null);
HttpListenerContext context =
listener.EndGetContext(listenerResult);
byte[] response = new byte[10];
context.Response.OutputStream.Write(response, 0, 10);
context.Response.ContentType = "text/plain";
Console.WriteLine("ContentType is: {0}",
context.Response.ContentType);
Console.Out.Flush();
Console.ReadLine();
}
}
}
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs