Example #1
0
 //- @SendUnknownResponseHeader -//
 public override void SendUnknownResponseHeader(String name, String value)
 {
     if (!this.headersSent)
     {
         this.ResponseHeadersBuilder.Append(name);
         this.ResponseHeadersBuilder.Append(": ");
         this.ResponseHeadersBuilder.Append(value);
         this.ResponseHeadersBuilder.Append("\r\n");
         //+
         ResponseHeaderList.Add(new DevServer.Service.Header
         {
             Name = name,
             Data = value
         });
     }
 }
Example #2
0
        //- @SendKnownResponseHeader -//
        public override void SendKnownResponseHeader(Int32 index, String value)
        {
            if (!this.headersSent)
            {
                switch (index)
                {
                case 1:
                case 2:
                case 0x1a:
                    return;

                case 0x12:
                case 0x13:
                    if (!this.SpecialCaseStaticFileHeaders)
                    {
                        break;
                    }
                    return;

                case 20:
                    if (!(value == "bytes"))
                    {
                        break;
                    }
                    this.SpecialCaseStaticFileHeaders = true;
                    return;
                }
                String name = HttpWorkerRequest.GetKnownResponseHeaderName(index);
                if (name == CommonHeaderName.ContentType)
                {
                    this.ResponseContentType = value;
                }
                this.ResponseHeadersBuilder.Append(name);
                this.ResponseHeadersBuilder.Append(": ");
                this.ResponseHeadersBuilder.Append(value);
                this.ResponseHeadersBuilder.Append("\r\n");
                //+
                ResponseHeaderList.Add(new DevServer.Service.Header
                {
                    Name = name,
                    Data = value
                });
            }
        }