stop middleware converting favicon to string

closes #4658

- adds conditional to prevent favicon being processed as a string