dotnet/aspnetcore
Stop using InvalidOperationExceptions to signal invalid ASCII during parsing
Aberta
#4.736 aberto em 19 de jul. de 2018
affected-very-fewarea-networkingenhancementfeature-kestrelhelp wantedseverity-nice-to-have
Métricas do repositório
- Stars
- (37.933 estrelas)
- Métricas de merge de PR
- (Métricas PR pendentes)
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.