Ejemplo n.º 1
0
 /// <summary>
 /// Sets <see cref="Value"/> after it has been quoted as defined by <see href="https://tools.ietf.org/html/rfc7230#section-3.2.6">the RFC specification</see>.
 /// </summary>
 /// <param name="value"></param>
 public void SetAndEscapeValue(StringSegment value)
 {
     HeaderUtilities.ThrowIfReadOnly(IsReadOnly);
     if (StringSegment.IsNullOrEmpty(value) || (GetValueLength(value, 0) == value.Length))
     {
         _value = value;
     }
     else
     {
         Value = HeaderUtilities.EscapeAsQuotedString(value);
     }
 }