Пример #1
0
 /// <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));
 }
Пример #2
0
    public void UnescapeAsQuotedString_BehaviorCheck(string input, string expected)
    {
        var actual = HeaderUtilities.UnescapeAsQuotedString(input);

        Assert.Equal(expected, actual);
    }
Пример #3
0
 public StringSegment UnescapeAsQuotedString()
 {
     return(HeaderUtilities.UnescapeAsQuotedString("\"hello\\\"foo\\\\bar\\\\baz\\\\\""));
 }