dotnet/aspnetcore

Stop using InvalidOperationExceptions to signal invalid ASCII during parsing

オープン

#4,736 opened on 2018/07/19

 (4 件のコメント) (0 件のリアクション) (0 人の担当者)C# (10,653 件のフォーク)batch import
affected-very-fewarea-networkingenhancementfeature-kestrelhelp wantedseverity-nice-to-have

Repository metrics

Stars
 (37,933 個のスター)
PR merge metrics
 (PR metrics pending)

説明

GetAsciiStringNonNullCharacters() currently throws an InvalidOperationException fo invalid or chacters, and the parsing logic catches these InvalidOperationExceptions at various layers to handle the bad request appropriately.

Ideally we could switch to calling a TryGetAsciiStringNonNullCharacters method, but if propagating failure down the stack proves too difficult, we should at least move to a custom exception type so we don't end up obscuring real product bugs by inadvertently swallowing InvalidOperationExceptions thrown by other methods.

コントリビューターガイド