dotnet/aspnetcore

Stop using InvalidOperationExceptions to signal invalid ASCII during parsing

Open

#4 736 ouverte le 19 juil. 2018

Voir sur GitHub
 (4 commentaires) (0 réactions) (0 assignés)C# (10 653 forks)batch import
affected-very-fewarea-networkingenhancementfeature-kestrelhelp wantedseverity-nice-to-have

Métriques du dépôt

Stars
 (37 933 stars)
Métriques de merge PR
 (Merge moyen 16j 9h) (258 PRs mergées en 30 j)

Description

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.

Guide contributeur