diff --git a/src/libraries/System.Net.Http/tests/UnitTests/Headers/ContentDispositionHeaderValueTest.cs b/src/libraries/System.Net.Http/tests/UnitTests/Headers/ContentDispositionHeaderValueTest.cs index cb44f49b767814..2d411c36e2cf71 100644 --- a/src/libraries/System.Net.Http/tests/UnitTests/Headers/ContentDispositionHeaderValueTest.cs +++ b/src/libraries/System.Net.Http/tests/UnitTests/Headers/ContentDispositionHeaderValueTest.cs @@ -1,14 +1,39 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Buffers; using System.Collections.Generic; using System.Linq; using System.Net.Http.Headers; - using Xunit; +using Xunit.Abstractions; namespace System.Net.Http.Tests { + public class Encode5987ReproTest + { + private static readonly IndexOfAnyValues s_rfc5987AttrBytes = + IndexOfAnyValues.Create("!#$&+-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz|~"u8); + + private readonly ITestOutputHelper _output; + + public Encode5987ReproTest(ITestOutputHelper output) + { + _output = output; + } + + [Fact] + public void IndexOfAnyExceptTest() + { + ReadOnlySpan bytes = new byte[] { 70, 105, 108, 101, 195, 131, 78, 97, 109, 101, 46, 98, 97, 116 }; + + int offset = bytes.IndexOfAnyExcept(s_rfc5987AttrBytes); + _output.WriteLine($"s_rfc5987AttrBytes is {s_rfc5987AttrBytes.GetType().FullName}"); + + Assert.Equal(4, offset); + } + } + public class ContentDispositionHeaderValueTest { [Fact] diff --git a/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs b/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs index 58a2a92ef19195..e9e80916061a61 100644 --- a/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs +++ b/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs @@ -17,6 +17,7 @@ namespace System { public partial class String { + // Hi private const int StackallocIntBufferSizeLimit = 128; private static void FillStringChecked(string dest, int destPos, string src)