Exemplo n.º 1
0
 public string this[HttpResponseHeader header]
 {
     get
     {
         if (!AllowHttpResponseHeader)
         {
             throw new InvalidOperationException(SR.net_headers_rsp);
         }
         return(this[header.GetName()]);
     }
     set
     {
         if (!AllowHttpResponseHeader)
         {
             throw new InvalidOperationException(SR.net_headers_rsp);
         }
         if (_type == WebHeaderCollectionType.HttpListenerResponse)
         {
             if (value != null && value.Length > ushort.MaxValue)
             {
                 throw new ArgumentOutOfRangeException("value", value, SR.Format(SR.net_headers_toolong, ushort.MaxValue));
             }
         }
         this[header.GetName()] = value;
     }
 }
Exemplo n.º 2
0
 public void Remove(HttpResponseHeader header)
 {
     if (!AllowHttpResponseHeader)
     {
         throw new InvalidOperationException(SR.net_headers_rsp);
     }
     this.Remove(header.GetName());
 }
Exemplo n.º 3
0
 public void Set(HttpResponseHeader header, string?value)
 {
     if (!AllowHttpResponseHeader)
     {
         throw new InvalidOperationException(SR.net_headers_rsp);
     }
     this.Set(header.GetName(), value);
 }
Exemplo n.º 4
0
 public string this[HttpResponseHeader header]
 {
     get
     {
         if (!AllowHttpResponseHeader)
         {
             throw new InvalidOperationException(SR.net_headers_rsp);
         }
         return(this[header.GetName()]);
     }
     set
     {
         if (!AllowHttpResponseHeader)
         {
             throw new InvalidOperationException(SR.net_headers_rsp);
         }
         this[header.GetName()] = value;
     }
 }
Exemplo n.º 5
0
 public void Add(HttpResponseHeader header, string value)
 {
     if (!AllowHttpResponseHeader)
     {
         throw new InvalidOperationException(SR.net_headers_rsp);
     }
     if (_type == WebHeaderCollectionType.WebResponse)
     {
         if (value != null && value.Length > ushort.MaxValue)
         {
             throw new ArgumentOutOfRangeException(nameof(value), value, string.Format(CultureInfo.InvariantCulture, SR.net_headers_toolong, ushort.MaxValue));
         }
     }
     this.Add(header.GetName(), value);
 }
Exemplo n.º 6
0
 public string this[HttpResponseHeader header]
 {
     get
     {
         if (!AllowHttpResponseHeader)
         {
             throw new InvalidOperationException(SR.net_headers_rsp);
         }
         return this[header.GetName()];
     }
     set
     {
         if (!AllowHttpResponseHeader)
         {
             throw new InvalidOperationException(SR.net_headers_rsp);
         }
         this[header.GetName()] = value;
     }
 }
Exemplo n.º 7
0
 public string this[HttpResponseHeader header]
 {
     get
     {
         if (!AllowHttpResponseHeader)
         {
             throw new InvalidOperationException(SR.net_headers_rsp);
         }
         return this[header.GetName()];
     }
     set
     {
         if (!AllowHttpResponseHeader)
         {
             throw new InvalidOperationException(SR.net_headers_rsp);
         }
         if (_type == WebHeaderCollectionType.HttpListenerResponse)
         {
             if (value != null && value.Length > ushort.MaxValue)
             {
                 throw new ArgumentOutOfRangeException("value", value, SR.Format(SR.net_headers_toolong, ushort.MaxValue));
             }
         }
         this[header.GetName()] = value;
     }
 }
Exemplo n.º 8
0
 public void Add(HttpResponseHeader header, string value)
 {
     if (!AllowHttpResponseHeader)
     {
         throw new InvalidOperationException(SR.net_headers_rsp);
     }
     if (_type == WebHeaderCollectionType.WebResponse)
     {
         if (value != null && value.Length > ushort.MaxValue)
         {
             throw new ArgumentOutOfRangeException(nameof(value), value, string.Format(CultureInfo.InvariantCulture, SR.net_headers_toolong, ushort.MaxValue));
         }
     }
     this.Add(header.GetName(), value);
 }
Exemplo n.º 9
0
 public void Remove(HttpResponseHeader header)
 {
     if (!AllowHttpResponseHeader)
     {
         throw new InvalidOperationException(SR.net_headers_rsp);
     }
     this.Remove(header.GetName());
 }