Fix an issue with JSON encoding of "Infinity" and "NaN" values
#26933

prathamesh-sonpatki wants to merge prathamesh-sonpatki:fix-26877 into rails:master

We do not currently have an analysis of these two commits