/// <summary>
 /// If the value is a quoted-string as defined by <see href="https://tools.ietf.org/html/rfc7230#section-3.2.6">the RFC specification</see>,
 /// removes quotes and unescapes backslashes and quotes.
 /// </summary>
 /// <returns>An unescaped version of <see cref="Value"/>.</returns>
 public StringSegment GetUnescapedValue()
 {
     if (!HeaderUtilities.IsQuoted(_value))
     {
         return(_value);
     }
     return(HeaderUtilities.UnescapeAsQuotedString(_value));
 }
Example #2
0
    public void UnescapeAsQuotedString_BehaviorCheck(string input, string expected)
    {
        var actual = HeaderUtilities.UnescapeAsQuotedString(input);

        Assert.Equal(expected, actual);
    }
 public StringSegment UnescapeAsQuotedString()
 {
     return(HeaderUtilities.UnescapeAsQuotedString("\"hello\\\"foo\\\\bar\\\\baz\\\\\""));
 }