Fixes https://github.com/aspnet/AspNetCore/issues/14623\n\nCommit migrated from b195e40af5
b195e40af5