We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e86b6c commit bbd739cCopy full SHA for bbd739c
src/Shared/ServerInfrastructure/StringUtilities.cs
@@ -683,9 +683,13 @@ private static bool IsValidHeaderString(string value)
683
new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true).GetByteCount(value);
684
return !value.Contains('\0');
685
}
686
- catch (DecoderFallbackException)
+ catch (ArgumentOutOfRangeException)
687
{
688
- return false;
+ return false; // 'value' too large to compute a UTF-8 byte count
689
+ }
690
+ catch (EncoderFallbackException)
691
+ {
692
+ return false; // 'value' cannot be converted losslessly to UTF-8
693
694
695
0 commit comments