Changeset 184 for SimpleHttpServer

Show
Ignore:
Timestamp:
07/25/07 03:56:04 (18 months ago)
Author:
mayuki
Message:
 
Location:
SimpleHttpServer/SimpleHttpServer
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • SimpleHttpServer/SimpleHttpServer/Program.cs

    r181 r184  
    2929        static void server_Request(Context ctx) 
    3030        { 
    31             using (StreamWriter sw = new StreamWriter(Context.Current.Stream)) 
     31            using (StreamWriter sw = new StreamWriter(ctx.Response.OutputStream)) 
    3232            { 
    33                 sw.WriteLine(); 
    34                 sw.WriteLine("HTTP/1.0 200 Ok"); 
    35                 sw.WriteLine("Content-Type: text/html; charset=utf-8"); 
    36                 sw.WriteLine("Connection: close"); 
    37                 sw.WriteLine(""); 
    38                 sw.WriteLine("<title>hauhau</title>"); 
     33                sw.WriteLine("<title>test</title>"); 
     34                sw.WriteLine("<h1>gaogao</h1>"); 
    3935            } 
    4036        } 
  • SimpleHttpServer/SimpleHttpServer/SimpleHttpServer.cs

    r183 r184  
    206206                if (ContentType.StartsWith("text/")) 
    207207                { 
    208                     sw.WriteLine("Conetent-Type: {0}; CharSet={1}", ContentType, CharSet); 
     208                    sw.WriteLine("Content-Type: {0}; charset={1}", ContentType, CharSet); 
    209209                } 
    210210                else 
    211211                { 
    212                     sw.WriteLine("Conetent-Type: {0}", ContentType); 
     212                    sw.WriteLine("Content-Type: {0}", ContentType); 
    213213                } 
    214214            }